Setting readyState to CLOSED when calling ::close()

This commit is contained in:
David Baird
2013-05-14 10:59:58 -06:00
parent 86ec5a65b1
commit af97883097
+4 -1
View File
@@ -148,7 +148,10 @@ struct _RealWebSocket : public WebSocket
if (ret > 0) { txbuf.erase(txbuf.begin(), txbuf.begin() + ret); } if (ret > 0) { txbuf.erase(txbuf.begin(), txbuf.begin() + ret); }
else { break; } else { break; }
} }
if (!txbuf.size() && readyState == CLOSING) { ::close(); } if (!txbuf.size() && readyState == CLOSING) {
::close();
readyState = CLOSED;
}
} }
// Callable must have signature: void(const std::string & message). // Callable must have signature: void(const std::string & message).