Fix signature for async_read_some, and tests

Signed-off-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
Casey Bodley
2017-11-08 21:01:34 -05:00
committed by Vinnie Falco
parent a1db3cab9f
commit f96785df4f
3 changed files with 22 additions and 1 deletions

View File

@ -2,6 +2,7 @@ Version 140:
* Fix some integer warnings in 64-bit builds
* Fix utf8_checker test failures
* Fix signature for async_read_some, and tests
--------------------------------------------------------------------------------

View File

@ -536,7 +536,8 @@ async_read_some(
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
"DynamicBuffer requirements not met");
BOOST_ASSERT(! parser.is_done());
boost::asio::async_completion<ReadHandler, void(error_code)> init{handler};
boost::asio::async_completion<ReadHandler,
void(error_code, std::size_t)> init{handler};
detail::read_some_op<AsyncReadStream,
DynamicBuffer, isRequest, Derived, BOOST_ASIO_HANDLER_TYPE(
ReadHandler, void(error_code, std::size_t))>{

View File

@ -311,6 +311,25 @@ public:
break;
}
BEAST_EXPECT(n < limit);
for(n = 0; n < limit; ++n)
{
test::fail_counter fc{n};
test::stream c{ioc_, fc,
"GET / HTTP/1.1\r\n"
"Host: localhost\r\n"
"User-Agent: test\r\n"
"Content-Length: 0\r\n"
"\r\n"
};
request_parser<dynamic_body> m;
error_code ec = test::error::fail_error;
multi_buffer b;
async_read_some(c, b, m, do_yield[ec]);
if(! ec)
break;
}
BEAST_EXPECT(n < limit);
}
void