From 0007afdaf2201562955823124d8884504c346420 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sat, 9 Sep 2017 06:39:49 -0700 Subject: [PATCH] Fix handler signature in async_read_header --- CHANGELOG.md | 6 ++++++ include/boost/beast/http/impl/read.ipp | 2 +- test/beast/http/read.cpp | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b3e1246..22198214 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Version 113: + +* Fix handler signature in async_read_header + +-------------------------------------------------------------------------------- + Version 112: * Update websocket notes diff --git a/include/boost/beast/http/impl/read.ipp b/include/boost/beast/http/impl/read.ipp index 21dce0a5..de5f963c 100644 --- a/include/boost/beast/http/impl/read.ipp +++ b/include/boost/beast/http/impl/read.ipp @@ -639,7 +639,7 @@ async_read_header( "DynamicBuffer requirements not met"); parser.eager(false); async_completion init{handler}; + void(error_code, std::size_t)> init{handler}; detail::read_op>{ diff --git a/test/beast/http/read.cpp b/test/beast/http/read.cpp index 1db94561..c58df607 100644 --- a/test/beast/http/read.cpp +++ b/test/beast/http/read.cpp @@ -90,6 +90,21 @@ public: } BEAST_EXPECT(n < limit); for(n = 0; n < limit; ++n) + { + multi_buffer b; + b.commit(buffer_copy( + b.prepare(len), buffer(s, len))); + test::fail_counter fc(n); + test::stream ts{ios_, fc}; + test_parser p(fc); + error_code ec = test::error::fail_error; + ts.close_remote(); + async_read_header(ts, b, p, do_yield[ec]); + if(! ec) + break; + } + BEAST_EXPECT(n < limit); + for(n = 0; n < limit; ++n) { static std::size_t constexpr pre = 10; multi_buffer b;