diff options
Diffstat (limited to 'zenhttp/websocketasio.cpp')
| -rw-r--r-- | zenhttp/websocketasio.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/zenhttp/websocketasio.cpp b/zenhttp/websocketasio.cpp index e9d065624..12b762b12 100644 --- a/zenhttp/websocketasio.cpp +++ b/zenhttp/websocketasio.cpp @@ -754,11 +754,7 @@ WsServer::CloseConnection(std::shared_ptr<WsConnection> Connection, const std::e { if (Ec) { - ZEN_LOG_INFO(LogWebSocket, - "connection '{}' closed, ERROR '{}' error code '{}'", - Connection->Id().Value(), - Ec.message(), - Ec.value()); + ZEN_LOG_INFO(LogWebSocket, "connection '{}' closed, reason '{} ({})'", Connection->Id().Value(), Ec.message(), Ec.value()); } else { @@ -1304,6 +1300,13 @@ WsClient::ReadMessage() m_ReadBuffer, asio::transfer_at_least(1), [Self = AsShared()](const asio::error_code& Ec, std::size_t ByteCount) mutable { + const WebSocketState State = Self->State(); + + if (State == WebSocketState::kDisconnected) + { + return; + } + if (Ec) { ZEN_LOG_WARN(LogWsClient, "read message FAILED, reason '{}'", Ec.message()); @@ -1311,8 +1314,6 @@ WsClient::ReadMessage() return Self->Disconnect(); } - const WebSocketState State = Self->State(); - switch (State) { case WebSocketState::kHandshaking: |