Skip to content

Commit 5014987

Browse files
committed
2.0.4
Fix array pointer Reduce string memory use
1 parent 9533fc2 commit 5014987

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"type": "git",
1313
"url": "https://github.com/me-no-dev/ESPAsyncWebServer.git"
1414
},
15-
"version": "2.0.3",
15+
"version": "2.0.4",
1616
"license": "LGPL-3.0",
1717
"frameworks": "arduino",
1818
"platforms": ["espressif8266", "espressif32"],

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ESP Async WebServer
2-
version=2.0.3
2+
version=2.0.4
33
author=Me-No-Dev
44
maintainer=Me-No-Dev
55
sentence=Async Web Server for ESP8266 and ESP31B (Aircoookie fork)

src/AsyncWebSocket.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,8 @@ AsyncWebSocketMultiMessage::~AsyncWebSocketMultiMessage() {
458458
/*
459459
* Async WebSocket Client
460460
*/
461-
const char * AWSC_PING_PAYLOAD = "ESPAsyncWebServer-PING";
462-
const size_t AWSC_PING_PAYLOAD_LEN = 22;
461+
const char * AWSC_PING_PAYLOAD = "awscPING";
462+
const size_t AWSC_PING_PAYLOAD_LEN = 8;
463463

464464
AsyncWebSocketClient::AsyncWebSocketClient(AsyncWebServerRequest *request, AsyncWebSocket *server)
465465
: _controlQueue(LinkedList<AsyncWebSocketControl *>([](AsyncWebSocketControl *c){ delete c; }))
@@ -551,7 +551,7 @@ void AsyncWebSocketClient::_queueMessage(AsyncWebSocketMessage *dataMessage){
551551
return;
552552
}
553553
if(_messageQueue.length() >= WS_MAX_QUEUED_MESSAGES){
554-
ets_printf("ERROR: Too many messages queued\n");
554+
ets_printf("ERR WSq\n");
555555
delete dataMessage;
556556
} else {
557557
_messageQueue.add(dataMessage);
@@ -1241,8 +1241,8 @@ AsyncWebSocketResponse::AsyncWebSocketResponse(const String& key, AsyncWebSocket
12411241
_code = 101;
12421242
_sendContentLength = false;
12431243

1244-
uint8_t * hash[20];
1245-
char * buffer[33];
1244+
uint8_t hash[20];
1245+
char buffer[33];
12461246

12471247
#ifdef ESP8266
12481248
sha1(key + WS_STR_UUID, hash);

src/WebAuthentication.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static bool getMD5(uint8_t * data, uint16_t len, char * output){//33 bytes or mo
6565
md5_context_t _ctx;
6666
#endif
6767
uint8_t i;
68-
uint8_t * _buf[16] = {0};
68+
uint8_t _buf[16] = {0};
6969
#ifdef ESP32
7070
mbedtls_md5_init(&_ctx);
7171
mbedtls_md5_starts_ret(&_ctx);
@@ -88,15 +88,15 @@ static String genRandomMD5(){
8888
#else
8989
uint32_t r = rand();
9090
#endif
91-
char * out[33];
91+
char out[33];
9292
if(out == NULL || !getMD5((uint8_t*)(&r), 4, out))
9393
return "";
9494
String res = String(out);
9595
return res;
9696
}
9797

9898
static String stringMD5(const String& in){
99-
char * out[33];
99+
char out[33];
100100
if(!getMD5((uint8_t*)(in.c_str()), in.length(), out))
101101
return "";
102102
String res = String(out);
@@ -107,7 +107,7 @@ String generateDigestHash(const char * username, const char * password, const ch
107107
if(username == NULL || password == NULL || realm == NULL){
108108
return "";
109109
}
110-
char * out[33];
110+
char out[33];
111111
String res = String(username);
112112
res.concat(":");
113113
res.concat(realm);

0 commit comments

Comments
 (0)