You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i experience a serious issue (which is perfectly reproducible), that crashes the server, if a client closes connection uncleanly (like wifi outage). This happens with version 1.2.0, as well as with latest master a9e7b73.
If the client crashed, the server stucks in calling the onerror handler repeatedly with reason "uncleanly".
diff --git a/include/crow/websocket.h b/include/crow/websocket.h
index 7c6694e32..0e2822ba5 100644
--- a/include/crow/websocket.h
+++ b/include/crow/websocket.h
@@ -725,9 +725,11 @@ namespace crow // NOTE: Already documented in "crow/app.h"
{
// Note that if the close handler was not yet called at this point we did not receive a close packet (or send one)
// and thus we use ClosedAbnormally unless instructed otherwise
- if (!is_close_handler_called_)
+ if (!is_close_handler_called_) {
if (close_handler_)
close_handler_(*this, "uncleanly", code);
+ is_close_handler_called_ = true;
+ }
handler_->remove_websocket(this);
if (sending_buffers_.empty() && !is_reading)
delete this;
The text was updated successfully, but these errors were encountered:
Hi there,
i experience a serious issue (which is perfectly reproducible), that crashes the server, if a client closes connection uncleanly (like wifi outage). This happens with version 1.2.0, as well as with latest master a9e7b73.
If the client crashed, the server stucks in calling the onerror handler repeatedly with reason "uncleanly".
This somehow seems related to #549 .
Edit: this very naive fix seems to do the trick:
The text was updated successfully, but these errors were encountered: