Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/AsyncEventSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ void AsyncEventSourceClient::_onPoll() {

void AsyncEventSourceClient::_onTimeout(uint32_t time __attribute__((unused))) {
if (_client) {
_client->close(true);
_client->close();
}
}

Expand Down
14 changes: 7 additions & 7 deletions src/AsyncWebSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,12 @@ void AsyncWebSocketClient::_onAck(size_t len, uint32_t time) {
#ifdef ESP32
/*
Unlocking has to be called before return execution otherwise std::unique_lock ::~unique_lock() will get an exception pthread_mutex_unlock.
Due to _client->close(true) shall call the callback function _onDisconnect()
Due to _client->close() shall call the callback function _onDisconnect()
The calling flow _onDisconnect() --> _handleDisconnect() --> ~AsyncWebSocketClient()
*/
lock.unlock();
#endif
_client->close(true);
_client->close();
}
return;
}
Expand Down Expand Up @@ -423,12 +423,12 @@ bool AsyncWebSocketClient::_queueMessage(AsyncWebSocketSharedBuffer buffer, uint
#ifdef ESP32
/*
Unlocking has to be called before return execution otherwise std::unique_lock ::~unique_lock() will get an exception pthread_mutex_unlock.
Due to _client->close(true) shall call the callback function _onDisconnect()
Due to _client->close() shall call the callback function _onDisconnect()
The calling flow _onDisconnect() --> _handleDisconnect() --> ~AsyncWebSocketClient()
*/
lock.unlock();
#endif
_client->close(true);
_client->close();
}

async_ws_log_e("Too many messages queued: closing connection");
Expand Down Expand Up @@ -497,7 +497,7 @@ void AsyncWebSocketClient::_onTimeout(uint32_t time) {
}
// Serial.println("onTime");
(void)time;
_client->close(true);
_client->close();
}

void AsyncWebSocketClient::_onDisconnect() {
Expand Down Expand Up @@ -582,7 +582,7 @@ void AsyncWebSocketClient::_onData(void *pbuf, size_t plen) {
if (_status == WS_DISCONNECTING) {
_status = WS_DISCONNECTED;
if (_client) {
_client->close(true);
_client->close();
}
} else {
_status = WS_DISCONNECTING;
Expand Down Expand Up @@ -1287,7 +1287,7 @@ AsyncWebSocketResponse::AsyncWebSocketResponse(const String &key, AsyncWebSocket

void AsyncWebSocketResponse::_respond(AsyncWebServerRequest *request) {
if (_state == RESPONSE_FAILED) {
request->client()->close(true);
request->client()->close();
return;
}
String out;
Expand Down
2 changes: 1 addition & 1 deletion src/WebResponses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ size_t AsyncAbstractResponse::_ack(AsyncWebServerRequest *request, size_t len, u
if (!_sendContentLength || _ackedLength >= _writtenLength) {
_state = RESPONSE_END;
if (!_chunked && !_sendContentLength) {
request->client()->close(true);
request->client()->close();
}
}
}
Expand Down