| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -563,8 +563,15 @@ void HTTPConnection::loop() { | |||
| 563 | 563 | HTTPS_LOGD("Calling WS handler, FID=%d", _socket); | |
| 564 | 564 | _wsHandler->loop(); | |
| 565 | 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 | + | ||
| 566 | 573 | // If the handler has terminated the connection, clean up and close the socket too | |
| 567 | - if (_wsHandler->closed()) { | ||
| 574 | + if (_wsHandler->closed() || _clientState == CSTATE_CLOSED) { | ||
| 568 | 575 | HTTPS_LOGI("WS closed, freeing Handler, FID=%d", _socket); | |
| 569 | 576 | delete _wsHandler; | |
| 570 | 577 | _wsHandler = nullptr; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments