From af978830978d14daddcd8b09f168626598f975ae Mon Sep 17 00:00:00 2001 From: David Baird Date: Tue, 14 May 2013 10:59:58 -0600 Subject: [PATCH] Setting readyState to CLOSED when calling ::close() --- easywsclient.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/easywsclient.cpp b/easywsclient.cpp index 5f60642..c7e089b 100644 --- a/easywsclient.cpp +++ b/easywsclient.cpp @@ -148,7 +148,10 @@ struct _RealWebSocket : public WebSocket if (ret > 0) { txbuf.erase(txbuf.begin(), txbuf.begin() + ret); } 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).