Skip to content

Commit 307b9ad

Browse files
committed
esp8266 bug fix, remoteOTA bin
1 parent da0328d commit 307b9ad

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed
212 KB
Binary file not shown.
34.2 KB
Binary file not shown.

src/AsyncFsWebServer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ IPAddress AsyncFsWebServer::startWiFi(uint32_t timeout, CallbackF fn, bool skipA
676676
if (!m_apSSID.length()) {
677677
char _ssid[21];
678678
#ifdef ESP8266
679-
snprintf(ssid, sizeof(ssid), "ESP-%dX", ESP.getChipId());
679+
snprintf(_ssid, sizeof(_ssid), "ESP-%dX", ESP.getChipId());
680680
#elif defined(ESP32)
681681
snprintf(_ssid, sizeof(_ssid), "ESP-%llX", ESP.getEfuseMac());
682682
#endif

src/ESPAsyncWebServer/src/AsyncWebSocket.cpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@
2020
*/
2121
#include "Arduino.h"
2222
#include "AsyncWebSocket.h"
23+
#include "../../SerialLog.h"
2324
#include <libb64/cencode.h>
2425

25-
#ifdef ESP8266
26-
#include <Hash.h>
27-
#else
28-
#if ESP_ARDUINO_VERSION_MAJOR > 2
29-
#include "SHA1Builder.h"
30-
#else
31-
#include "mbedtls/sha1.h"
32-
#endif
26+
#ifdef ESP8266
27+
#include <Hash.h>
28+
#else
29+
#if ESP_ARDUINO_VERSION_MAJOR > 2
30+
#include "SHA1Builder.h"
31+
#else
32+
#include "mbedtls/sha1.h"
33+
#endif
3334
#endif
3435

3536
#define MAX_PRINTF_LEN 64
@@ -622,7 +623,7 @@ void AsyncWebSocketClient::_queueMessage(AsyncWebSocketMessage *dataMessage){
622623
return;
623624
}
624625
if(_messageQueue.length() >= WS_MAX_QUEUED_MESSAGES){
625-
log_e("ERROR: Too many messages queued");
626+
log_error("ERROR: Too many messages queued");
626627
// Serial.printf("%u Q3\n", _clientId);
627628
delete dataMessage;
628629
} else {
@@ -769,7 +770,7 @@ void AsyncWebSocketClient::_onData(void *pbuf, size_t plen){
769770
} else if(_pinfo.opcode < 8){//continuation or text/binary frame
770771
_server->_handleEvent(this, WS_EVT_DATA, (void *)&_pinfo, data, datalen);
771772
if (_pinfo.final) _pinfo.num = 0;
772-
else _pinfo.num += 1;
773+
else _pinfo.num += 1;
773774
}
774775
} else {
775776
//os_printf("frame error: len: %u, index: %llu, total: %llu\n", datalen, _pinfo.index, _pinfo.len);
@@ -1265,14 +1266,14 @@ void AsyncWebSocket::handleRequest(AsyncWebServerRequest *request){
12651266
if((_username.length() && _password.length()) && !request->authenticate(_username.c_str(), _password.c_str())){
12661267
return request->requestAuthentication();
12671268
}
1268-
//////////////////////////////////////////
1269+
//////////////////////////////////////////
12691270
if(_handshakeHandler != nullptr){
12701271
if(!_handshakeHandler(request)){
12711272
request->send(401);
12721273
return;
12731274
}
12741275
}
1275-
//////////////////////////////////////////
1276+
//////////////////////////////////////////
12761277
AsyncWebHeader* version = request->getHeader(WS_STR_VERSION);
12771278
if(version->value().toInt() != 13){
12781279
AsyncWebServerResponse *response = request->beginResponse(400);
@@ -1360,7 +1361,7 @@ AsyncWebSocketResponse::AsyncWebSocketResponse(const String& key, AsyncWebSocket
13601361
sha1.calculate();
13611362
sha1.getBytes(hash);
13621363
#else
1363-
1364+
13641365
(String&)key += WS_STR_UUID;
13651366
mbedtls_sha1_context ctx;
13661367
mbedtls_sha1_init(&ctx);

0 commit comments

Comments
 (0)