We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4e66fe5 + 46acd74 commit f80b961Copy full SHA for f80b961
src/HTTPConnection.cpp
@@ -563,8 +563,15 @@ void HTTPConnection::loop() {
563
HTTPS_LOGD("Calling WS handler, FID=%d", _socket);
564
_wsHandler->loop();
565
}
566
+
567
+ // If the client closed the connection unexpectedly
568
+ if (_clientState == CSTATE_CLOSED) {
569
+ HTTPS_LOGI("WS lost client, calling onClose, FID=%d", _socket);
570
+ _wsHandler->onClose();
571
+ }
572
573
// If the handler has terminated the connection, clean up and close the socket too
- if (_wsHandler->closed()) {
574
+ if (_wsHandler->closed() || _clientState == CSTATE_CLOSED) {
575
HTTPS_LOGI("WS closed, freeing Handler, FID=%d", _socket);
576
delete _wsHandler;
577
_wsHandler = nullptr;
0 commit comments