diff --git a/CHANGELOG.md b/CHANGELOG.md index 8798fcfc..6f0c58e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Version 121: + +* Add test for issue 802 + +-------------------------------------------------------------------------------- + Version 120: * Fix spurious strand_ in advanced_server_flex diff --git a/test/beast/websocket/read.cpp b/test/beast/websocket/read.cpp index 96f3121e..a04a9cdd 100644 --- a/test/beast/websocket/read.cpp +++ b/test/beast/websocket/read.cpp @@ -1008,6 +1008,27 @@ public: } } + void + testIssue802() + { + for(std::size_t i = 0; i < 100; ++i) + { + echo_server es{log, kind::async}; + boost::asio::io_service ios; + stream ws{ios}; + ws.next_layer().connect(es.stream()); + ws.handshake("localhost", "/"); + // too-big message frame indicates payload of 2^64-1 + boost::asio::write(ws.next_layer(), sbuf( + "\x81\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff")); + multi_buffer b; + error_code ec; + ws.read(b, ec); + BEAST_EXPECT(ec == error::closed); + BEAST_EXPECT(ws.reason().code == 1009); + } + } + void run() override { @@ -1015,6 +1036,7 @@ public: testSuspend(); testParseFrame(); testContHook(); + testIssue802(); } };