diff --git a/ixwebsocket/IXWebSocketTransport.cpp b/ixwebsocket/IXWebSocketTransport.cpp index 7e00cf5b..459fe37f 100644 --- a/ixwebsocket/IXWebSocketTransport.cpp +++ b/ixwebsocket/IXWebSocketTransport.cpp @@ -700,6 +700,7 @@ namespace ix if (_readyState != ReadyState::CLOSING) { // send back the CLOSE frame + setReadyState(ReadyState::CLOSING); sendCloseFrame(code, reason); wakeUpFromPoll(SelectInterrupt::kCloseRequest); @@ -1072,7 +1073,10 @@ namespace ix else if (ret <= 0) { closeSocket(); - setReadyState(ReadyState::CLOSED); + if (_readyState != ReadyState::CLOSING) + { + setReadyState(ReadyState::CLOSED); + } return false; } else diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c8822a40..36e2204f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -24,14 +24,13 @@ set (TEST_TARGET_NAMES # IXWebSocketBroadcastTest ## FIXME was depending on cobra / take a broadcast server from ws IXStrCaseCompareTest IXExponentialBackoffTest + IXWebSocketCloseTest ) # Some unittest don't work on windows yet # Windows without TLS does not have hmac yet if (UNIX) list(APPEND TEST_TARGET_NAMES - IXWebSocketCloseTest - # Fail on Windows in CI probably because the pathing is wrong and # some resource files cannot be found IXHttpServerTest