Eliminate trailing data on close. Fixes #21.

This commit is contained in:
David Baird
2013-11-14 00:00:28 -07:00
parent d678234e90
commit e610b3c626
+2 -2
View File
@@ -353,8 +353,8 @@ class _RealWebSocket : public easywsclient::WebSocket
void close() {
if(readyState == CLOSING || readyState == CLOSED) { return; }
readyState = CLOSING;
uint8_t closeFrame[4] = {0x88, 0x00, 0x00, 0x00};
std::vector<uint8_t> header(closeFrame, closeFrame+4);
uint8_t closeFrame[2] = {0x88, 0x00};
std::vector<uint8_t> header(closeFrame, closeFrame+2);
txbuf.insert(txbuf.end(), header.begin(), header.end());
}