fix incorrect closures with code 1011 Internal error (#450)

* fix incorrect closures with code 1011 Internal error

* enable IXWebSocketCloseTest
This commit is contained in:
ouwou
2023-03-30 03:45:29 +00:00
committed by GitHub
parent dc7b986e10
commit f184a7adef
2 changed files with 6 additions and 3 deletions

View File

@ -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