mirror of
https://github.com/boostorg/beast.git
synced 2025-07-31 21:34:46 +02:00
@@ -3,6 +3,7 @@ Version 41
|
||||
* Trim Appveyor matrix rows
|
||||
* Concept revision and documentation
|
||||
* Remove coveralls integration
|
||||
* Tidy up formal parameter names
|
||||
|
||||
API Changes
|
||||
|
||||
|
@@ -505,7 +505,7 @@ public:
|
||||
*/
|
||||
template<class DynamicBuffer>
|
||||
std::size_t
|
||||
copy_body(DynamicBuffer& dynabuf);
|
||||
copy_body(DynamicBuffer& buffer);
|
||||
|
||||
/** Returns a set of buffers for storing body data.
|
||||
|
||||
|
@@ -579,7 +579,7 @@ async_return_type<
|
||||
ReadHandler, void(error_code, std::size_t)>
|
||||
async_read_some(
|
||||
AsyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
basic_parser<isRequest, true, Derived>& parser,
|
||||
ReadHandler&& handler)
|
||||
{
|
||||
@@ -592,14 +592,14 @@ async_read_some(
|
||||
detail::read_some_buffer_op<AsyncReadStream,
|
||||
DynamicBuffer, isRequest, true, Derived, handler_type<
|
||||
ReadHandler, void(error_code, std::size_t)>>{
|
||||
init.completion_handler, stream, dynabuf, parser};
|
||||
init.completion_handler, stream, buffer, parser};
|
||||
break;
|
||||
|
||||
default:
|
||||
detail::read_some_body_op<AsyncReadStream,
|
||||
DynamicBuffer, isRequest, Derived, handler_type<
|
||||
ReadHandler, void(error_code, std::size_t)>>{
|
||||
init.completion_handler, stream, dynabuf, parser};
|
||||
init.completion_handler, stream, buffer, parser};
|
||||
break;
|
||||
}
|
||||
return init.result.get();
|
||||
@@ -615,7 +615,7 @@ async_return_type<
|
||||
ReadHandler, void(error_code, std::size_t)>
|
||||
async_read_some(
|
||||
AsyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
basic_parser<isRequest, false, Derived>& parser,
|
||||
ReadHandler&& handler)
|
||||
{
|
||||
@@ -624,7 +624,7 @@ async_read_some(
|
||||
detail::read_some_buffer_op<AsyncReadStream,
|
||||
DynamicBuffer, isRequest, false, Derived, handler_type<
|
||||
ReadHandler, void(error_code, std::size_t)>>{
|
||||
init.completion_handler, stream, dynabuf, parser};
|
||||
init.completion_handler, stream, buffer, parser};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
@@ -641,7 +641,7 @@ async_return_type<
|
||||
ReadHandler, void(error_code, std::size_t)>
|
||||
async_read_some(
|
||||
AsyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
basic_parser<isRequest, isDirect, Derived>& parser,
|
||||
ReadHandler&& handler)
|
||||
{
|
||||
@@ -650,7 +650,7 @@ async_read_some(
|
||||
static_assert(is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
BOOST_ASSERT(! parser.is_complete());
|
||||
return detail::async_read_some(stream, dynabuf, parser,
|
||||
return detail::async_read_some(stream, buffer, parser,
|
||||
std::forward<ReadHandler>(handler));
|
||||
}
|
||||
|
||||
@@ -663,7 +663,7 @@ async_return_type<
|
||||
ReadHandler, void(error_code)>
|
||||
async_read(
|
||||
AsyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
basic_parser<isRequest, isDirect, Derived>& parser,
|
||||
ReadHandler&& handler)
|
||||
{
|
||||
@@ -677,7 +677,7 @@ async_read(
|
||||
detail::parse_op<AsyncReadStream, DynamicBuffer,
|
||||
isRequest, isDirect, Derived, handler_type<
|
||||
ReadHandler, void(error_code)>>{
|
||||
init.completion_handler, stream, dynabuf, parser};
|
||||
init.completion_handler, stream, buffer, parser};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
@@ -690,7 +690,7 @@ async_return_type<
|
||||
ReadHandler, void(error_code)>
|
||||
async_read(
|
||||
AsyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
message<isRequest, Body, Fields>& msg,
|
||||
ReadHandler&& handler)
|
||||
{
|
||||
@@ -710,7 +710,7 @@ async_read(
|
||||
detail::read_message_op<AsyncReadStream, DynamicBuffer,
|
||||
isRequest, Body, Fields, handler_type<
|
||||
ReadHandler, void(error_code)>>{
|
||||
init.completion_handler, stream, dynabuf, msg};
|
||||
init.completion_handler, stream, buffer, msg};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
|
@@ -117,14 +117,14 @@ template<bool isRequest, bool isDirect, class Derived>
|
||||
template<class DynamicBuffer>
|
||||
std::size_t
|
||||
basic_parser<isRequest, isDirect, Derived>::
|
||||
copy_body(DynamicBuffer& dynabuf)
|
||||
copy_body(DynamicBuffer& buffer)
|
||||
{
|
||||
// This function not available when isDirect==false
|
||||
static_assert(isDirect, "");
|
||||
|
||||
using boost::asio::buffer_copy;
|
||||
using boost::asio::buffer_size;
|
||||
BOOST_ASSERT(dynabuf.size() > 0);
|
||||
BOOST_ASSERT(buffer.size() > 0);
|
||||
BOOST_ASSERT(
|
||||
state_ == parse_state::body ||
|
||||
state_ == parse_state::body_to_eof ||
|
||||
@@ -135,14 +135,14 @@ copy_body(DynamicBuffer& dynabuf)
|
||||
case parse_state::body_to_eof:
|
||||
{
|
||||
auto const buffers =
|
||||
impl().on_prepare(dynabuf.size());
|
||||
impl().on_prepare(buffer.size());
|
||||
BOOST_ASSERT(
|
||||
buffer_size(buffers) >= 1 &&
|
||||
buffer_size(buffers) <=
|
||||
dynabuf.size());
|
||||
buffer.size());
|
||||
auto const n = buffer_copy(
|
||||
buffers, dynabuf.data());
|
||||
dynabuf.consume(n);
|
||||
buffers, buffer.data());
|
||||
buffer.consume(n);
|
||||
impl().on_commit(n);
|
||||
return n;
|
||||
}
|
||||
@@ -158,7 +158,7 @@ copy_body(DynamicBuffer& dynabuf)
|
||||
buffer_size(buffers) <=
|
||||
beast::detail::clamp(len_));
|
||||
auto const n = buffer_copy(
|
||||
buffers, dynabuf.data());
|
||||
buffers, buffer.data());
|
||||
commit_body(n);
|
||||
return n;
|
||||
}
|
||||
|
@@ -32,17 +32,17 @@ inline
|
||||
std::size_t
|
||||
read_some_buffer(
|
||||
SyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
basic_parser<isRequest, isDirect, Derived>& parser,
|
||||
error_code& ec)
|
||||
{
|
||||
std::size_t bytes_used;
|
||||
if(dynabuf.size() == 0)
|
||||
if(buffer.size() == 0)
|
||||
goto do_read;
|
||||
for(;;)
|
||||
{
|
||||
bytes_used = parser.write(
|
||||
dynabuf.data(), ec);
|
||||
buffer.data(), ec);
|
||||
if(ec)
|
||||
return 0;
|
||||
if(bytes_used > 0)
|
||||
@@ -51,11 +51,11 @@ read_some_buffer(
|
||||
boost::optional<typename
|
||||
DynamicBuffer::mutable_buffers_type> mb;
|
||||
auto const size =
|
||||
read_size_helper(dynabuf, 65536);
|
||||
read_size_helper(buffer, 65536);
|
||||
BOOST_ASSERT(size > 0);
|
||||
try
|
||||
{
|
||||
mb.emplace(dynabuf.prepare(size));
|
||||
mb.emplace(buffer.prepare(size));
|
||||
}
|
||||
catch(std::length_error const&)
|
||||
{
|
||||
@@ -86,7 +86,7 @@ read_some_buffer(
|
||||
return 0;
|
||||
}
|
||||
BOOST_ASSERT(bytes_transferred > 0);
|
||||
dynabuf.commit(bytes_transferred);
|
||||
buffer.commit(bytes_transferred);
|
||||
}
|
||||
do_finish:
|
||||
return bytes_used;
|
||||
@@ -100,12 +100,12 @@ inline
|
||||
std::size_t
|
||||
read_some_body(
|
||||
SyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
basic_parser<isRequest, true, Derived>& parser,
|
||||
error_code& ec)
|
||||
{
|
||||
if(dynabuf.size() > 0)
|
||||
return parser.copy_body(dynabuf);
|
||||
if(buffer.size() > 0)
|
||||
return parser.copy_body(buffer);
|
||||
boost::optional<typename
|
||||
Derived::mutable_buffers_type> mb;
|
||||
try
|
||||
@@ -145,7 +145,7 @@ inline
|
||||
std::size_t
|
||||
read_some(
|
||||
SyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
basic_parser<isRequest, true, Derived>& parser,
|
||||
error_code& ec)
|
||||
{
|
||||
@@ -154,11 +154,11 @@ read_some(
|
||||
case parse_state::header:
|
||||
case parse_state::chunk_header:
|
||||
return detail::read_some_buffer(
|
||||
stream, dynabuf, parser, ec);
|
||||
stream, buffer, parser, ec);
|
||||
|
||||
default:
|
||||
return detail::read_some_body(
|
||||
stream, dynabuf, parser, ec);
|
||||
stream, buffer, parser, ec);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,12 +170,12 @@ inline
|
||||
std::size_t
|
||||
read_some(
|
||||
SyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
basic_parser<isRequest, false, Derived>& parser,
|
||||
error_code& ec)
|
||||
{
|
||||
return detail::read_some_buffer(
|
||||
stream, dynabuf, parser, ec);
|
||||
stream, buffer, parser, ec);
|
||||
}
|
||||
|
||||
} // detail
|
||||
@@ -189,7 +189,7 @@ template<
|
||||
std::size_t
|
||||
read_some(
|
||||
SyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
basic_parser<isRequest, isDirect, Derived>& parser)
|
||||
{
|
||||
static_assert(is_sync_read_stream<SyncReadStream>::value,
|
||||
@@ -199,7 +199,7 @@ read_some(
|
||||
BOOST_ASSERT(! parser.is_complete());
|
||||
error_code ec;
|
||||
auto const bytes_used =
|
||||
read_some(stream, dynabuf, parser, ec);
|
||||
read_some(stream, buffer, parser, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
return bytes_used;
|
||||
@@ -212,7 +212,7 @@ template<
|
||||
std::size_t
|
||||
read_some(
|
||||
SyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
basic_parser<isRequest, isDirect, Derived>& parser,
|
||||
error_code& ec)
|
||||
{
|
||||
@@ -221,7 +221,7 @@ read_some(
|
||||
static_assert(is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
BOOST_ASSERT(! parser.is_complete());
|
||||
return detail::read_some(stream, dynabuf, parser, ec);
|
||||
return detail::read_some(stream, buffer, parser, ec);
|
||||
}
|
||||
|
||||
template<
|
||||
@@ -231,7 +231,7 @@ template<
|
||||
void
|
||||
read(
|
||||
SyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
basic_parser<isRequest, isDirect, Derived>& parser)
|
||||
{
|
||||
static_assert(is_sync_read_stream<SyncReadStream>::value,
|
||||
@@ -240,7 +240,7 @@ read(
|
||||
"DynamicBuffer requirements not met");
|
||||
BOOST_ASSERT(! parser.is_complete());
|
||||
error_code ec;
|
||||
read(stream, dynabuf, parser, ec);
|
||||
read(stream, buffer, parser, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
}
|
||||
@@ -252,7 +252,7 @@ template<
|
||||
void
|
||||
read(
|
||||
SyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
basic_parser<isRequest, isDirect, Derived>& parser,
|
||||
error_code& ec)
|
||||
{
|
||||
@@ -264,10 +264,10 @@ read(
|
||||
do
|
||||
{
|
||||
auto const bytes_used =
|
||||
read_some(stream, dynabuf, parser, ec);
|
||||
read_some(stream, buffer, parser, ec);
|
||||
if(ec)
|
||||
return;
|
||||
dynabuf.consume(bytes_used);
|
||||
buffer.consume(bytes_used);
|
||||
}
|
||||
while(! parser.is_complete());
|
||||
}
|
||||
@@ -279,7 +279,7 @@ template<
|
||||
void
|
||||
read(
|
||||
SyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
message<isRequest, Body, Fields>& msg)
|
||||
{
|
||||
static_assert(is_sync_read_stream<SyncReadStream>::value,
|
||||
@@ -294,7 +294,7 @@ read(
|
||||
message<isRequest, Body, Fields>>::value,
|
||||
"Reader requirements not met");
|
||||
error_code ec;
|
||||
beast::http::read(stream, dynabuf, msg, ec);
|
||||
beast::http::read(stream, buffer, msg, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
}
|
||||
@@ -306,7 +306,7 @@ template<
|
||||
void
|
||||
read(
|
||||
SyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
message<isRequest, Body, Fields>& msg,
|
||||
error_code& ec)
|
||||
{
|
||||
@@ -322,7 +322,7 @@ read(
|
||||
message<isRequest, Body, Fields>>::value,
|
||||
"Reader requirements not met");
|
||||
message_parser<isRequest, Body, Fields> p;
|
||||
beast::http::read(stream, dynabuf, p, ec);
|
||||
beast::http::read(stream, buffer, p, ec);
|
||||
if(ec)
|
||||
return;
|
||||
msg = p.release();
|
||||
|
@@ -49,7 +49,7 @@ namespace http {
|
||||
@param stream The stream from which the data is to be read.
|
||||
The type must support the @b SyncReadStream concept.
|
||||
|
||||
@param dynabuf A @b DynamicBuffer holding additional bytes
|
||||
@param buffer A @b DynamicBuffer holding additional bytes
|
||||
read by the implementation from the stream. This is both
|
||||
an input and an output parameter; on entry, any data in the
|
||||
dynamic buffer's input sequence will be given to the parser
|
||||
@@ -70,7 +70,7 @@ template<
|
||||
std::size_t
|
||||
read_some(
|
||||
SyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
basic_parser<isRequest, isDirect, Derived>& parser);
|
||||
|
||||
/** Read some HTTP/1 message data from a stream.
|
||||
@@ -105,7 +105,7 @@ read_some(
|
||||
@param stream The stream from which the data is to be read.
|
||||
The type must support the @b SyncReadStream concept.
|
||||
|
||||
@param dynabuf A @b DynamicBuffer holding additional bytes
|
||||
@param buffer A @b DynamicBuffer holding additional bytes
|
||||
read by the implementation from the stream. This is both
|
||||
an input and an output parameter; on entry, any data in the
|
||||
dynamic buffer's input sequence will be given to the parser
|
||||
@@ -126,7 +126,7 @@ template<
|
||||
std::size_t
|
||||
read_some(
|
||||
SyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
basic_parser<isRequest, isDirect, Derived>& parser,
|
||||
error_code& ec);
|
||||
|
||||
@@ -169,7 +169,7 @@ read_some(
|
||||
@param stream The stream from which the data is to be read.
|
||||
The type must support the @b AsyncReadStream concept.
|
||||
|
||||
@param dynabuf A @b DynamicBuffer holding additional bytes
|
||||
@param buffer A @b DynamicBuffer holding additional bytes
|
||||
read by the implementation from the stream. This is both
|
||||
an input and an output parameter; on entry, any data in the
|
||||
dynamic buffer's input sequence will be given to the parser
|
||||
@@ -198,7 +198,7 @@ async_return_type<
|
||||
ReadHandler, void(error_code, std::size_t)>
|
||||
async_read_some(
|
||||
AsyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
basic_parser<isRequest, isDirect, Derived>& parser,
|
||||
ReadHandler&& handler);
|
||||
|
||||
@@ -228,7 +228,7 @@ async_read_some(
|
||||
@param stream The stream from which the data is to be read.
|
||||
The type must support the @b SyncReadStream concept.
|
||||
|
||||
@param dynabuf A @b DynamicBuffer holding additional bytes
|
||||
@param buffer A @b DynamicBuffer holding additional bytes
|
||||
read by the implementation from the stream. This is both
|
||||
an input and an output parameter; on entry, any data in the
|
||||
dynamic buffer's input sequence will be given to the parser
|
||||
@@ -245,7 +245,7 @@ template<
|
||||
void
|
||||
read(
|
||||
SyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
basic_parser<isRequest, isDirect, Derived>& parser);
|
||||
|
||||
/** Read an HTTP/1 message from a stream.
|
||||
@@ -272,7 +272,7 @@ read(
|
||||
@param stream The stream from which the data is to be read.
|
||||
The type must support the @b SyncReadStream concept.
|
||||
|
||||
@param dynabuf A @b DynamicBuffer holding additional bytes
|
||||
@param buffer A @b DynamicBuffer holding additional bytes
|
||||
read by the implementation from the stream. This is both
|
||||
an input and an output parameter; on entry, any data in the
|
||||
dynamic buffer's input sequence will be given to the parser
|
||||
@@ -289,7 +289,7 @@ template<
|
||||
void
|
||||
read(
|
||||
SyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
basic_parser<isRequest, isDirect, Derived>& parser,
|
||||
error_code& ec);
|
||||
|
||||
@@ -320,7 +320,7 @@ read(
|
||||
@param stream The stream from which the data is to be read.
|
||||
The type must support the @b AsyncReadStream concept.
|
||||
|
||||
@param dynabuf A @b DynamicBuffer holding additional bytes
|
||||
@param buffer A @b DynamicBuffer holding additional bytes
|
||||
read by the implementation from the stream. This is both
|
||||
an input and an output parameter; on entry, any data in the
|
||||
dynamic buffer's input sequence will be given to the parser
|
||||
@@ -348,7 +348,7 @@ async_return_type<
|
||||
ReadHandler, void(error_code)>
|
||||
async_read(
|
||||
AsyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
basic_parser<isRequest, isDirect, Derived>& parser,
|
||||
ReadHandler&& handler);
|
||||
|
||||
@@ -376,7 +376,7 @@ async_read(
|
||||
@param stream The stream from which the data is to be read.
|
||||
The type must support the @b SyncReadStream concept.
|
||||
|
||||
@param dynabuf A @b DynamicBuffer holding additional bytes
|
||||
@param buffer A @b DynamicBuffer holding additional bytes
|
||||
read by the implementation from the stream. This is both
|
||||
an input and an output parameter; on entry, any data in the
|
||||
dynamic buffer's input sequence will be given to the parser
|
||||
@@ -395,7 +395,7 @@ template<
|
||||
void
|
||||
read(
|
||||
SyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
message<isRequest, Body, Fields>& msg);
|
||||
|
||||
/** Read a HTTP/1 message from a stream.
|
||||
@@ -422,7 +422,7 @@ read(
|
||||
@param stream The stream from which the data is to be read.
|
||||
The type must support the @b SyncReadStream concept.
|
||||
|
||||
@param dynabuf A @b DynamicBuffer holding additional bytes
|
||||
@param buffer A @b DynamicBuffer holding additional bytes
|
||||
read by the implementation from the stream. This is both
|
||||
an input and an output parameter; on entry, any data in the
|
||||
dynamic buffer's input sequence will be given to the parser
|
||||
@@ -441,7 +441,7 @@ template<
|
||||
void
|
||||
read(
|
||||
SyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
message<isRequest, Body, Fields>& msg,
|
||||
error_code& ec);
|
||||
|
||||
@@ -472,7 +472,7 @@ read(
|
||||
@param stream The stream to read the message from.
|
||||
The type must support the @b AsyncReadStream concept.
|
||||
|
||||
@param dynabuf A @b DynamicBuffer holding additional bytes
|
||||
@param buffer A @b DynamicBuffer holding additional bytes
|
||||
read by the implementation from the stream. This is both
|
||||
an input and an output parameter; on entry, any data in the
|
||||
dynamic buffer's input sequence will be given to the parser
|
||||
@@ -503,7 +503,7 @@ async_return_type<
|
||||
ReadHandler, void(error_code)>
|
||||
async_read(
|
||||
AsyncReadStream& stream,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
message<isRequest, Body, Fields>& msg,
|
||||
ReadHandler&& handler);
|
||||
|
||||
|
@@ -356,7 +356,7 @@ template<class InflateStream, class DynamicBuffer>
|
||||
void
|
||||
inflate(
|
||||
InflateStream& zi,
|
||||
DynamicBuffer& dynabuf,
|
||||
DynamicBuffer& buffer,
|
||||
boost::asio::const_buffer const& in,
|
||||
error_code& ec)
|
||||
{
|
||||
@@ -368,13 +368,13 @@ inflate(
|
||||
for(;;)
|
||||
{
|
||||
// VFALCO we could be smarter about the size
|
||||
auto const bs = dynabuf.prepare(
|
||||
read_size_helper(dynabuf, 65536));
|
||||
auto const bs = buffer.prepare(
|
||||
read_size_helper(buffer, 65536));
|
||||
auto const out = *bs.begin();
|
||||
zs.avail_out = buffer_size(out);
|
||||
zs.next_out = buffer_cast<void*>(out);
|
||||
zi.write(zs, zlib::Flush::sync, ec);
|
||||
dynabuf.commit(zs.total_out);
|
||||
buffer.commit(zs.total_out);
|
||||
zs.total_out = 0;
|
||||
if( ec == zlib::error::need_buffers ||
|
||||
ec == zlib::error::end_of_stream)
|
||||
|
@@ -689,7 +689,7 @@ async_return_type<
|
||||
ReadHandler, void(error_code)>
|
||||
stream<NextLayer>::
|
||||
async_read_frame(frame_info& fi,
|
||||
DynamicBuffer& dynabuf, ReadHandler&& handler)
|
||||
DynamicBuffer& buffer, ReadHandler&& handler)
|
||||
{
|
||||
static_assert(is_async_stream<next_layer_type>::value,
|
||||
"AsyncStream requirements requirements not met");
|
||||
@@ -699,7 +699,7 @@ async_read_frame(frame_info& fi,
|
||||
void(error_code)> init{handler};
|
||||
read_frame_op<DynamicBuffer, handler_type<
|
||||
ReadHandler, void(error_code)>>{init.completion_handler,
|
||||
*this, fi, dynabuf};
|
||||
*this, fi, buffer};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
@@ -707,14 +707,14 @@ template<class NextLayer>
|
||||
template<class DynamicBuffer>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
read_frame(frame_info& fi, DynamicBuffer& dynabuf)
|
||||
read_frame(frame_info& fi, DynamicBuffer& buffer)
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(beast::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
error_code ec;
|
||||
read_frame(fi, dynabuf, ec);
|
||||
read_frame(fi, buffer, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
}
|
||||
@@ -1101,7 +1101,7 @@ async_return_type<
|
||||
ReadHandler, void(error_code)>
|
||||
stream<NextLayer>::
|
||||
async_read(opcode& op,
|
||||
DynamicBuffer& dynabuf, ReadHandler&& handler)
|
||||
DynamicBuffer& buffer, ReadHandler&& handler)
|
||||
{
|
||||
static_assert(is_async_stream<next_layer_type>::value,
|
||||
"AsyncStream requirements requirements not met");
|
||||
@@ -1111,7 +1111,7 @@ async_read(opcode& op,
|
||||
void(error_code)> init{handler};
|
||||
read_op<DynamicBuffer, handler_type<
|
||||
ReadHandler, void(error_code)>>{init.completion_handler,
|
||||
*this, op, dynabuf};
|
||||
*this, op, buffer};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
@@ -1119,14 +1119,14 @@ template<class NextLayer>
|
||||
template<class DynamicBuffer>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
read(opcode& op, DynamicBuffer& dynabuf)
|
||||
read(opcode& op, DynamicBuffer& buffer)
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(beast::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
error_code ec;
|
||||
read(op, dynabuf, ec);
|
||||
read(op, buffer, ec);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
}
|
||||
@@ -1135,7 +1135,7 @@ template<class NextLayer>
|
||||
template<class DynamicBuffer>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
read(opcode& op, DynamicBuffer& dynabuf, error_code& ec)
|
||||
read(opcode& op, DynamicBuffer& buffer, error_code& ec)
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
@@ -1144,7 +1144,7 @@ read(opcode& op, DynamicBuffer& dynabuf, error_code& ec)
|
||||
frame_info fi;
|
||||
for(;;)
|
||||
{
|
||||
read_frame(fi, dynabuf, ec);
|
||||
read_frame(fi, buffer, ec);
|
||||
if(ec)
|
||||
break;
|
||||
op = fi.op;
|
||||
|
@@ -2351,14 +2351,14 @@ public:
|
||||
@param op A value to receive the message type.
|
||||
This object must remain valid until the handler is called.
|
||||
|
||||
@param dynabuf A dynamic buffer to hold the message data after
|
||||
@param buffer A dynamic buffer to hold the message data after
|
||||
any masking or decompression has been applied.
|
||||
|
||||
@throws system_error Thrown on failure.
|
||||
*/
|
||||
template<class DynamicBuffer>
|
||||
void
|
||||
read(opcode& op, DynamicBuffer& dynabuf);
|
||||
read(opcode& op, DynamicBuffer& buffer);
|
||||
|
||||
/** Read a message from the stream.
|
||||
|
||||
@@ -2391,14 +2391,14 @@ public:
|
||||
@param op A value to receive the message type.
|
||||
This object must remain valid until the handler is called.
|
||||
|
||||
@param dynabuf A dynamic buffer to hold the message data after
|
||||
@param buffer A dynamic buffer to hold the message data after
|
||||
any masking or decompression has been applied.
|
||||
|
||||
@param ec Set to indicate what error occurred, if any.
|
||||
*/
|
||||
template<class DynamicBuffer>
|
||||
void
|
||||
read(opcode& op, DynamicBuffer& dynabuf, error_code& ec);
|
||||
read(opcode& op, DynamicBuffer& buffer, error_code& ec);
|
||||
|
||||
/** Start an asynchronous operation to read a message from the stream.
|
||||
|
||||
@@ -2442,7 +2442,7 @@ public:
|
||||
@param op A value to receive the message type.
|
||||
This object must remain valid until the handler is called.
|
||||
|
||||
@param dynabuf A dynamic buffer to hold the message data after
|
||||
@param buffer A dynamic buffer to hold the message data after
|
||||
any masking or decompression has been applied. This object must
|
||||
remain valid until the handler is called.
|
||||
|
||||
@@ -2462,7 +2462,7 @@ public:
|
||||
template<class DynamicBuffer, class ReadHandler>
|
||||
async_return_type<
|
||||
ReadHandler, void(error_code)>
|
||||
async_read(opcode& op, DynamicBuffer& dynabuf, ReadHandler&& handler);
|
||||
async_read(opcode& op, DynamicBuffer& buffer, ReadHandler&& handler);
|
||||
|
||||
/** Read a message frame from the stream.
|
||||
|
||||
@@ -2498,14 +2498,14 @@ public:
|
||||
|
||||
@param fi An object to store metadata about the message.
|
||||
|
||||
@param dynabuf A dynamic buffer to hold the message data after
|
||||
@param buffer A dynamic buffer to hold the message data after
|
||||
any masking or decompression has been applied.
|
||||
|
||||
@throws system_error Thrown on failure.
|
||||
*/
|
||||
template<class DynamicBuffer>
|
||||
void
|
||||
read_frame(frame_info& fi, DynamicBuffer& dynabuf);
|
||||
read_frame(frame_info& fi, DynamicBuffer& buffer);
|
||||
|
||||
/** Read a message frame from the stream.
|
||||
|
||||
@@ -2541,14 +2541,14 @@ public:
|
||||
|
||||
@param fi An object to store metadata about the message.
|
||||
|
||||
@param dynabuf A dynamic buffer to hold the message data after
|
||||
@param buffer A dynamic buffer to hold the message data after
|
||||
any masking or decompression has been applied.
|
||||
|
||||
@param ec Set to indicate what error occurred, if any.
|
||||
*/
|
||||
template<class DynamicBuffer>
|
||||
void
|
||||
read_frame(frame_info& fi, DynamicBuffer& dynabuf, error_code& ec);
|
||||
read_frame(frame_info& fi, DynamicBuffer& buffer, error_code& ec);
|
||||
|
||||
/** Start an asynchronous operation to read a message frame from the stream.
|
||||
|
||||
@@ -2596,7 +2596,7 @@ public:
|
||||
@param fi An object to store metadata about the message.
|
||||
This object must remain valid until the handler is called.
|
||||
|
||||
@param dynabuf A dynamic buffer to hold the message data after
|
||||
@param buffer A dynamic buffer to hold the message data after
|
||||
any masking or decompression has been applied. This object must
|
||||
remain valid until the handler is called.
|
||||
|
||||
@@ -2617,7 +2617,7 @@ public:
|
||||
async_return_type<
|
||||
ReadHandler, void(error_code)>
|
||||
async_read_frame(frame_info& fi,
|
||||
DynamicBuffer& dynabuf, ReadHandler&& handler);
|
||||
DynamicBuffer& buffer, ReadHandler&& handler);
|
||||
|
||||
/** Write a message to the stream.
|
||||
|
||||
|
@@ -37,12 +37,12 @@ public:
|
||||
beast::test::string_istream ss{get_io_service(), s};
|
||||
error_code ec;
|
||||
#if 0
|
||||
multi_buffer dynabuf;
|
||||
multi_buffer buffer;
|
||||
#else
|
||||
flat_buffer dynabuf{1024};
|
||||
flat_buffer buffer{1024};
|
||||
#endif
|
||||
message<isRequest, string_body, fields> m;
|
||||
read(ss, dynabuf, m, ec);
|
||||
read(ss, buffer, m, ec);
|
||||
if(! BEAST_EXPECTS(! ec, ec.message()))
|
||||
return;
|
||||
pred(m);
|
||||
|
@@ -263,9 +263,9 @@ public:
|
||||
class NextLayer, class DynamicBuffer>
|
||||
void
|
||||
read(stream<NextLayer>& ws,
|
||||
opcode& op, DynamicBuffer& dynabuf) const
|
||||
opcode& op, DynamicBuffer& buffer) const
|
||||
{
|
||||
ws.read(op, dynabuf);
|
||||
ws.read(op, buffer);
|
||||
}
|
||||
|
||||
template<
|
||||
@@ -499,10 +499,10 @@ public:
|
||||
class NextLayer, class DynamicBuffer>
|
||||
void
|
||||
read(stream<NextLayer>& ws,
|
||||
opcode& op, DynamicBuffer& dynabuf) const
|
||||
opcode& op, DynamicBuffer& buffer) const
|
||||
{
|
||||
error_code ec;
|
||||
ws.async_read(op, dynabuf, yield_[ec]);
|
||||
ws.async_read(op, buffer, yield_[ec]);
|
||||
if(ec)
|
||||
throw system_error{ec};
|
||||
}
|
||||
|
Reference in New Issue
Block a user