Skip to content

Commit b003963

Browse files
Merge branch 'main' into fix/posix-websocket-broadcast-race
2 parents 53662c4 + db32763 commit b003963

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

examples/arduino/PerfTests/PerfTests.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ void loop() {
239239

240240
#ifdef ESP32
241241
if (now - lastHeap >= 2000) {
242-
Serial.printf("Uptime: %3lu s, requests: %3u, Free heap: %" PRIu32 "\n", millis() / 1000, requests, ESP.getFreeHeap());
242+
Serial.printf("Uptime: %3lu s, requests: %3u, Free heap: %" PRIu32 ", Min free heap: %" PRIu32 "\n", millis() / 1000, requests, ESP.getFreeHeap(), ESP.getMinFreeHeap());
243243
lastHeap = now;
244244
}
245245
#endif

examples/arduino/WebSocket/WebSocket.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ void loop() {
210210
ws.pingAll();
211211

212212
#ifdef ESP32
213-
Serial.printf("Free heap: %" PRIu32 "\n", ESP.getFreeHeap());
213+
Serial.printf("Uptime: %3lu s, Free heap: %" PRIu32 ", Min free heap: %" PRIu32 "\n", millis() / 1000, ESP.getFreeHeap(), ESP.getMinFreeHeap());
214214
#endif
215215
lastHeap = now;
216216
}

src/AsyncWebSocket.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ void AsyncWebSocketClient::_onAck(size_t len, uint32_t time) {
367367

368368
void AsyncWebSocketClient::_onPoll() {
369369
asyncsrv::unique_lock_type lock(_lock);
370+
370371
if (!_client) {
371372
return;
372373
}
@@ -454,6 +455,7 @@ bool AsyncWebSocketClient::canSend() const {
454455

455456
bool AsyncWebSocketClient::_queueControl(uint8_t opcode, const uint8_t *data, size_t len, bool mask) {
456457
asyncsrv::lock_guard_type lock(_lock);
458+
457459
if (!_client) {
458460
return false;
459461
}
@@ -470,6 +472,7 @@ bool AsyncWebSocketClient::_queueControl(uint8_t opcode, const uint8_t *data, si
470472

471473
bool AsyncWebSocketClient::_queueMessage(AsyncWebSocketSharedBuffer buffer, uint8_t opcode, bool mask) {
472474
asyncsrv::unique_lock_type lock(_lock);
475+
473476
if (!_client || !buffer || buffer->empty() || _status != WS_CONNECTED) {
474477
return false;
475478
}
@@ -958,6 +961,7 @@ bool AsyncWebSocketClient::binary(const __FlashStringHelper *data, size_t len) {
958961

959962
IPAddress AsyncWebSocketClient::remoteIP() const {
960963
asyncsrv::lock_guard_type lock(_lock);
964+
961965
if (!_client) {
962966
return IPAddress((uint32_t)0U);
963967
}
@@ -967,6 +971,7 @@ IPAddress AsyncWebSocketClient::remoteIP() const {
967971

968972
uint16_t AsyncWebSocketClient::remotePort() const {
969973
asyncsrv::lock_guard_type lock(_lock);
974+
970975
if (!_client) {
971976
return 0;
972977
}

0 commit comments

Comments
 (0)