Fix websocket read of zero length message

fix #686
This commit is contained in:
Vinnie Falco
2017-07-27 19:09:15 -07:00
parent c7b830f37f
commit cbb47a0ffd
3 changed files with 190 additions and 165 deletions
+10
View File
@@ -1638,6 +1638,16 @@ public:
}
c.handshake(ws, "localhost", "/");
// send empty message
ws.text(true);
c.write(ws, boost::asio::null_buffers{});
{
// receive echoed message
multi_buffer db;
c.read(ws, db);
BEAST_EXPECT(ws.got_text());
BEAST_EXPECT(db.size() == 0);
}
// send message
ws.auto_fragment(false);
ws.binary(false);