Add test for issue 802

This commit is contained in:
Vinnie Falco
2017-10-03 05:29:01 -07:00
parent 7fe74b1bf5
commit f5f1b7d6fa
2 changed files with 28 additions and 0 deletions

View File

@ -1,3 +1,9 @@
Version 121:
* Add test for issue 802
--------------------------------------------------------------------------------
Version 120:
* Fix spurious strand_ in advanced_server_flex

View File

@ -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<test::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();
}
};