add comments
This commit is contained in:
parent
776227edcb
commit
d4cdbe6141
@ -302,12 +302,15 @@ namespace ix
|
|||||||
{
|
{
|
||||||
_socket->close();
|
_socket->close();
|
||||||
|
|
||||||
|
// if there are received data pending to be processed, then delay the abnormal closure
|
||||||
|
// to after dispatch (other close code/reason could be read from the buffer)
|
||||||
if (_rxbuf.size() > 0)
|
if (_rxbuf.size() > 0)
|
||||||
{
|
{
|
||||||
_treatAbnormalCloseAfterDispatch = true;
|
_treatAbnormalCloseAfterDispatch = true;
|
||||||
|
|
||||||
setReadyState(CLOSING);
|
setReadyState(CLOSING);
|
||||||
}
|
}
|
||||||
|
// no received data pending processing, so we can close directly
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_treatAbnormalCloseAfterDispatch = false;
|
_treatAbnormalCloseAfterDispatch = false;
|
||||||
@ -572,6 +575,8 @@ namespace ix
|
|||||||
_rxbuf.begin() + ws.header_size + (size_t) ws.N);
|
_rxbuf.begin() + ws.header_size + (size_t) ws.N);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if an abnormal closure was raised, and nothing else triggered a CLOSED state in
|
||||||
|
// the received and processed data, then close using abnormal close code and message
|
||||||
if (_readyState == CLOSING && _treatAbnormalCloseAfterDispatch)
|
if (_readyState == CLOSING && _treatAbnormalCloseAfterDispatch)
|
||||||
{
|
{
|
||||||
_treatAbnormalCloseAfterDispatch = false;
|
_treatAbnormalCloseAfterDispatch = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user