Tidy up formal parameter names

fix #361
This commit is contained in:
Vinnie Falco
2017-05-13 09:27:06 -07:00
parent 8d329b2368
commit afde7508f1
11 changed files with 98 additions and 97 deletions

View File

@@ -3,6 +3,7 @@ Version 41
* Trim Appveyor matrix rows * Trim Appveyor matrix rows
* Concept revision and documentation * Concept revision and documentation
* Remove coveralls integration * Remove coveralls integration
* Tidy up formal parameter names
API Changes API Changes

View File

@@ -505,7 +505,7 @@ public:
*/ */
template<class DynamicBuffer> template<class DynamicBuffer>
std::size_t std::size_t
copy_body(DynamicBuffer& dynabuf); copy_body(DynamicBuffer& buffer);
/** Returns a set of buffers for storing body data. /** Returns a set of buffers for storing body data.

View File

@@ -579,7 +579,7 @@ async_return_type<
ReadHandler, void(error_code, std::size_t)> ReadHandler, void(error_code, std::size_t)>
async_read_some( async_read_some(
AsyncReadStream& stream, AsyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
basic_parser<isRequest, true, Derived>& parser, basic_parser<isRequest, true, Derived>& parser,
ReadHandler&& handler) ReadHandler&& handler)
{ {
@@ -592,14 +592,14 @@ async_read_some(
detail::read_some_buffer_op<AsyncReadStream, detail::read_some_buffer_op<AsyncReadStream,
DynamicBuffer, isRequest, true, Derived, handler_type< DynamicBuffer, isRequest, true, Derived, handler_type<
ReadHandler, void(error_code, std::size_t)>>{ ReadHandler, void(error_code, std::size_t)>>{
init.completion_handler, stream, dynabuf, parser}; init.completion_handler, stream, buffer, parser};
break; break;
default: default:
detail::read_some_body_op<AsyncReadStream, detail::read_some_body_op<AsyncReadStream,
DynamicBuffer, isRequest, Derived, handler_type< DynamicBuffer, isRequest, Derived, handler_type<
ReadHandler, void(error_code, std::size_t)>>{ ReadHandler, void(error_code, std::size_t)>>{
init.completion_handler, stream, dynabuf, parser}; init.completion_handler, stream, buffer, parser};
break; break;
} }
return init.result.get(); return init.result.get();
@@ -615,7 +615,7 @@ async_return_type<
ReadHandler, void(error_code, std::size_t)> ReadHandler, void(error_code, std::size_t)>
async_read_some( async_read_some(
AsyncReadStream& stream, AsyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
basic_parser<isRequest, false, Derived>& parser, basic_parser<isRequest, false, Derived>& parser,
ReadHandler&& handler) ReadHandler&& handler)
{ {
@@ -624,7 +624,7 @@ async_read_some(
detail::read_some_buffer_op<AsyncReadStream, detail::read_some_buffer_op<AsyncReadStream,
DynamicBuffer, isRequest, false, Derived, handler_type< DynamicBuffer, isRequest, false, Derived, handler_type<
ReadHandler, void(error_code, std::size_t)>>{ ReadHandler, void(error_code, std::size_t)>>{
init.completion_handler, stream, dynabuf, parser}; init.completion_handler, stream, buffer, parser};
return init.result.get(); return init.result.get();
} }
@@ -641,7 +641,7 @@ async_return_type<
ReadHandler, void(error_code, std::size_t)> ReadHandler, void(error_code, std::size_t)>
async_read_some( async_read_some(
AsyncReadStream& stream, AsyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
basic_parser<isRequest, isDirect, Derived>& parser, basic_parser<isRequest, isDirect, Derived>& parser,
ReadHandler&& handler) ReadHandler&& handler)
{ {
@@ -650,7 +650,7 @@ async_read_some(
static_assert(is_dynamic_buffer<DynamicBuffer>::value, static_assert(is_dynamic_buffer<DynamicBuffer>::value,
"DynamicBuffer requirements not met"); "DynamicBuffer requirements not met");
BOOST_ASSERT(! parser.is_complete()); 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)); std::forward<ReadHandler>(handler));
} }
@@ -663,7 +663,7 @@ async_return_type<
ReadHandler, void(error_code)> ReadHandler, void(error_code)>
async_read( async_read(
AsyncReadStream& stream, AsyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
basic_parser<isRequest, isDirect, Derived>& parser, basic_parser<isRequest, isDirect, Derived>& parser,
ReadHandler&& handler) ReadHandler&& handler)
{ {
@@ -677,7 +677,7 @@ async_read(
detail::parse_op<AsyncReadStream, DynamicBuffer, detail::parse_op<AsyncReadStream, DynamicBuffer,
isRequest, isDirect, Derived, handler_type< isRequest, isDirect, Derived, handler_type<
ReadHandler, void(error_code)>>{ ReadHandler, void(error_code)>>{
init.completion_handler, stream, dynabuf, parser}; init.completion_handler, stream, buffer, parser};
return init.result.get(); return init.result.get();
} }
@@ -690,7 +690,7 @@ async_return_type<
ReadHandler, void(error_code)> ReadHandler, void(error_code)>
async_read( async_read(
AsyncReadStream& stream, AsyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
message<isRequest, Body, Fields>& msg, message<isRequest, Body, Fields>& msg,
ReadHandler&& handler) ReadHandler&& handler)
{ {
@@ -710,7 +710,7 @@ async_read(
detail::read_message_op<AsyncReadStream, DynamicBuffer, detail::read_message_op<AsyncReadStream, DynamicBuffer,
isRequest, Body, Fields, handler_type< isRequest, Body, Fields, handler_type<
ReadHandler, void(error_code)>>{ ReadHandler, void(error_code)>>{
init.completion_handler, stream, dynabuf, msg}; init.completion_handler, stream, buffer, msg};
return init.result.get(); return init.result.get();
} }

View File

@@ -117,14 +117,14 @@ template<bool isRequest, bool isDirect, class Derived>
template<class DynamicBuffer> template<class DynamicBuffer>
std::size_t std::size_t
basic_parser<isRequest, isDirect, Derived>:: basic_parser<isRequest, isDirect, Derived>::
copy_body(DynamicBuffer& dynabuf) copy_body(DynamicBuffer& buffer)
{ {
// This function not available when isDirect==false // This function not available when isDirect==false
static_assert(isDirect, ""); static_assert(isDirect, "");
using boost::asio::buffer_copy; using boost::asio::buffer_copy;
using boost::asio::buffer_size; using boost::asio::buffer_size;
BOOST_ASSERT(dynabuf.size() > 0); BOOST_ASSERT(buffer.size() > 0);
BOOST_ASSERT( BOOST_ASSERT(
state_ == parse_state::body || state_ == parse_state::body ||
state_ == parse_state::body_to_eof || state_ == parse_state::body_to_eof ||
@@ -135,14 +135,14 @@ copy_body(DynamicBuffer& dynabuf)
case parse_state::body_to_eof: case parse_state::body_to_eof:
{ {
auto const buffers = auto const buffers =
impl().on_prepare(dynabuf.size()); impl().on_prepare(buffer.size());
BOOST_ASSERT( BOOST_ASSERT(
buffer_size(buffers) >= 1 && buffer_size(buffers) >= 1 &&
buffer_size(buffers) <= buffer_size(buffers) <=
dynabuf.size()); buffer.size());
auto const n = buffer_copy( auto const n = buffer_copy(
buffers, dynabuf.data()); buffers, buffer.data());
dynabuf.consume(n); buffer.consume(n);
impl().on_commit(n); impl().on_commit(n);
return n; return n;
} }
@@ -158,7 +158,7 @@ copy_body(DynamicBuffer& dynabuf)
buffer_size(buffers) <= buffer_size(buffers) <=
beast::detail::clamp(len_)); beast::detail::clamp(len_));
auto const n = buffer_copy( auto const n = buffer_copy(
buffers, dynabuf.data()); buffers, buffer.data());
commit_body(n); commit_body(n);
return n; return n;
} }

View File

@@ -32,17 +32,17 @@ inline
std::size_t std::size_t
read_some_buffer( read_some_buffer(
SyncReadStream& stream, SyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
basic_parser<isRequest, isDirect, Derived>& parser, basic_parser<isRequest, isDirect, Derived>& parser,
error_code& ec) error_code& ec)
{ {
std::size_t bytes_used; std::size_t bytes_used;
if(dynabuf.size() == 0) if(buffer.size() == 0)
goto do_read; goto do_read;
for(;;) for(;;)
{ {
bytes_used = parser.write( bytes_used = parser.write(
dynabuf.data(), ec); buffer.data(), ec);
if(ec) if(ec)
return 0; return 0;
if(bytes_used > 0) if(bytes_used > 0)
@@ -51,11 +51,11 @@ read_some_buffer(
boost::optional<typename boost::optional<typename
DynamicBuffer::mutable_buffers_type> mb; DynamicBuffer::mutable_buffers_type> mb;
auto const size = auto const size =
read_size_helper(dynabuf, 65536); read_size_helper(buffer, 65536);
BOOST_ASSERT(size > 0); BOOST_ASSERT(size > 0);
try try
{ {
mb.emplace(dynabuf.prepare(size)); mb.emplace(buffer.prepare(size));
} }
catch(std::length_error const&) catch(std::length_error const&)
{ {
@@ -86,7 +86,7 @@ read_some_buffer(
return 0; return 0;
} }
BOOST_ASSERT(bytes_transferred > 0); BOOST_ASSERT(bytes_transferred > 0);
dynabuf.commit(bytes_transferred); buffer.commit(bytes_transferred);
} }
do_finish: do_finish:
return bytes_used; return bytes_used;
@@ -100,12 +100,12 @@ inline
std::size_t std::size_t
read_some_body( read_some_body(
SyncReadStream& stream, SyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
basic_parser<isRequest, true, Derived>& parser, basic_parser<isRequest, true, Derived>& parser,
error_code& ec) error_code& ec)
{ {
if(dynabuf.size() > 0) if(buffer.size() > 0)
return parser.copy_body(dynabuf); return parser.copy_body(buffer);
boost::optional<typename boost::optional<typename
Derived::mutable_buffers_type> mb; Derived::mutable_buffers_type> mb;
try try
@@ -145,7 +145,7 @@ inline
std::size_t std::size_t
read_some( read_some(
SyncReadStream& stream, SyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
basic_parser<isRequest, true, Derived>& parser, basic_parser<isRequest, true, Derived>& parser,
error_code& ec) error_code& ec)
{ {
@@ -154,11 +154,11 @@ read_some(
case parse_state::header: case parse_state::header:
case parse_state::chunk_header: case parse_state::chunk_header:
return detail::read_some_buffer( return detail::read_some_buffer(
stream, dynabuf, parser, ec); stream, buffer, parser, ec);
default: default:
return detail::read_some_body( return detail::read_some_body(
stream, dynabuf, parser, ec); stream, buffer, parser, ec);
} }
} }
@@ -170,12 +170,12 @@ inline
std::size_t std::size_t
read_some( read_some(
SyncReadStream& stream, SyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
basic_parser<isRequest, false, Derived>& parser, basic_parser<isRequest, false, Derived>& parser,
error_code& ec) error_code& ec)
{ {
return detail::read_some_buffer( return detail::read_some_buffer(
stream, dynabuf, parser, ec); stream, buffer, parser, ec);
} }
} // detail } // detail
@@ -189,7 +189,7 @@ template<
std::size_t std::size_t
read_some( read_some(
SyncReadStream& stream, SyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
basic_parser<isRequest, isDirect, Derived>& parser) basic_parser<isRequest, isDirect, Derived>& parser)
{ {
static_assert(is_sync_read_stream<SyncReadStream>::value, static_assert(is_sync_read_stream<SyncReadStream>::value,
@@ -199,7 +199,7 @@ read_some(
BOOST_ASSERT(! parser.is_complete()); BOOST_ASSERT(! parser.is_complete());
error_code ec; error_code ec;
auto const bytes_used = auto const bytes_used =
read_some(stream, dynabuf, parser, ec); read_some(stream, buffer, parser, ec);
if(ec) if(ec)
throw system_error{ec}; throw system_error{ec};
return bytes_used; return bytes_used;
@@ -212,7 +212,7 @@ template<
std::size_t std::size_t
read_some( read_some(
SyncReadStream& stream, SyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
basic_parser<isRequest, isDirect, Derived>& parser, basic_parser<isRequest, isDirect, Derived>& parser,
error_code& ec) error_code& ec)
{ {
@@ -221,7 +221,7 @@ read_some(
static_assert(is_dynamic_buffer<DynamicBuffer>::value, static_assert(is_dynamic_buffer<DynamicBuffer>::value,
"DynamicBuffer requirements not met"); "DynamicBuffer requirements not met");
BOOST_ASSERT(! parser.is_complete()); BOOST_ASSERT(! parser.is_complete());
return detail::read_some(stream, dynabuf, parser, ec); return detail::read_some(stream, buffer, parser, ec);
} }
template< template<
@@ -231,7 +231,7 @@ template<
void void
read( read(
SyncReadStream& stream, SyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
basic_parser<isRequest, isDirect, Derived>& parser) basic_parser<isRequest, isDirect, Derived>& parser)
{ {
static_assert(is_sync_read_stream<SyncReadStream>::value, static_assert(is_sync_read_stream<SyncReadStream>::value,
@@ -240,7 +240,7 @@ read(
"DynamicBuffer requirements not met"); "DynamicBuffer requirements not met");
BOOST_ASSERT(! parser.is_complete()); BOOST_ASSERT(! parser.is_complete());
error_code ec; error_code ec;
read(stream, dynabuf, parser, ec); read(stream, buffer, parser, ec);
if(ec) if(ec)
throw system_error{ec}; throw system_error{ec};
} }
@@ -252,7 +252,7 @@ template<
void void
read( read(
SyncReadStream& stream, SyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
basic_parser<isRequest, isDirect, Derived>& parser, basic_parser<isRequest, isDirect, Derived>& parser,
error_code& ec) error_code& ec)
{ {
@@ -264,10 +264,10 @@ read(
do do
{ {
auto const bytes_used = auto const bytes_used =
read_some(stream, dynabuf, parser, ec); read_some(stream, buffer, parser, ec);
if(ec) if(ec)
return; return;
dynabuf.consume(bytes_used); buffer.consume(bytes_used);
} }
while(! parser.is_complete()); while(! parser.is_complete());
} }
@@ -279,7 +279,7 @@ template<
void void
read( read(
SyncReadStream& stream, SyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
message<isRequest, Body, Fields>& msg) message<isRequest, Body, Fields>& msg)
{ {
static_assert(is_sync_read_stream<SyncReadStream>::value, static_assert(is_sync_read_stream<SyncReadStream>::value,
@@ -294,7 +294,7 @@ read(
message<isRequest, Body, Fields>>::value, message<isRequest, Body, Fields>>::value,
"Reader requirements not met"); "Reader requirements not met");
error_code ec; error_code ec;
beast::http::read(stream, dynabuf, msg, ec); beast::http::read(stream, buffer, msg, ec);
if(ec) if(ec)
throw system_error{ec}; throw system_error{ec};
} }
@@ -306,7 +306,7 @@ template<
void void
read( read(
SyncReadStream& stream, SyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
message<isRequest, Body, Fields>& msg, message<isRequest, Body, Fields>& msg,
error_code& ec) error_code& ec)
{ {
@@ -322,7 +322,7 @@ read(
message<isRequest, Body, Fields>>::value, message<isRequest, Body, Fields>>::value,
"Reader requirements not met"); "Reader requirements not met");
message_parser<isRequest, Body, Fields> p; message_parser<isRequest, Body, Fields> p;
beast::http::read(stream, dynabuf, p, ec); beast::http::read(stream, buffer, p, ec);
if(ec) if(ec)
return; return;
msg = p.release(); msg = p.release();

View File

@@ -49,7 +49,7 @@ namespace http {
@param stream The stream from which the data is to be read. @param stream The stream from which the data is to be read.
The type must support the @b SyncReadStream concept. 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 read by the implementation from the stream. This is both
an input and an output parameter; on entry, any data in the an input and an output parameter; on entry, any data in the
dynamic buffer's input sequence will be given to the parser dynamic buffer's input sequence will be given to the parser
@@ -70,7 +70,7 @@ template<
std::size_t std::size_t
read_some( read_some(
SyncReadStream& stream, SyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
basic_parser<isRequest, isDirect, Derived>& parser); basic_parser<isRequest, isDirect, Derived>& parser);
/** Read some HTTP/1 message data from a stream. /** 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. @param stream The stream from which the data is to be read.
The type must support the @b SyncReadStream concept. 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 read by the implementation from the stream. This is both
an input and an output parameter; on entry, any data in the an input and an output parameter; on entry, any data in the
dynamic buffer's input sequence will be given to the parser dynamic buffer's input sequence will be given to the parser
@@ -126,7 +126,7 @@ template<
std::size_t std::size_t
read_some( read_some(
SyncReadStream& stream, SyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
basic_parser<isRequest, isDirect, Derived>& parser, basic_parser<isRequest, isDirect, Derived>& parser,
error_code& ec); error_code& ec);
@@ -169,7 +169,7 @@ read_some(
@param stream The stream from which the data is to be read. @param stream The stream from which the data is to be read.
The type must support the @b AsyncReadStream concept. 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 read by the implementation from the stream. This is both
an input and an output parameter; on entry, any data in the an input and an output parameter; on entry, any data in the
dynamic buffer's input sequence will be given to the parser 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)> ReadHandler, void(error_code, std::size_t)>
async_read_some( async_read_some(
AsyncReadStream& stream, AsyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
basic_parser<isRequest, isDirect, Derived>& parser, basic_parser<isRequest, isDirect, Derived>& parser,
ReadHandler&& handler); ReadHandler&& handler);
@@ -228,7 +228,7 @@ async_read_some(
@param stream The stream from which the data is to be read. @param stream The stream from which the data is to be read.
The type must support the @b SyncReadStream concept. 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 read by the implementation from the stream. This is both
an input and an output parameter; on entry, any data in the an input and an output parameter; on entry, any data in the
dynamic buffer's input sequence will be given to the parser dynamic buffer's input sequence will be given to the parser
@@ -245,7 +245,7 @@ template<
void void
read( read(
SyncReadStream& stream, SyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
basic_parser<isRequest, isDirect, Derived>& parser); basic_parser<isRequest, isDirect, Derived>& parser);
/** Read an HTTP/1 message from a stream. /** 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. @param stream The stream from which the data is to be read.
The type must support the @b SyncReadStream concept. 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 read by the implementation from the stream. This is both
an input and an output parameter; on entry, any data in the an input and an output parameter; on entry, any data in the
dynamic buffer's input sequence will be given to the parser dynamic buffer's input sequence will be given to the parser
@@ -289,7 +289,7 @@ template<
void void
read( read(
SyncReadStream& stream, SyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
basic_parser<isRequest, isDirect, Derived>& parser, basic_parser<isRequest, isDirect, Derived>& parser,
error_code& ec); error_code& ec);
@@ -320,7 +320,7 @@ read(
@param stream The stream from which the data is to be read. @param stream The stream from which the data is to be read.
The type must support the @b AsyncReadStream concept. 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 read by the implementation from the stream. This is both
an input and an output parameter; on entry, any data in the an input and an output parameter; on entry, any data in the
dynamic buffer's input sequence will be given to the parser dynamic buffer's input sequence will be given to the parser
@@ -348,7 +348,7 @@ async_return_type<
ReadHandler, void(error_code)> ReadHandler, void(error_code)>
async_read( async_read(
AsyncReadStream& stream, AsyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
basic_parser<isRequest, isDirect, Derived>& parser, basic_parser<isRequest, isDirect, Derived>& parser,
ReadHandler&& handler); ReadHandler&& handler);
@@ -376,7 +376,7 @@ async_read(
@param stream The stream from which the data is to be read. @param stream The stream from which the data is to be read.
The type must support the @b SyncReadStream concept. 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 read by the implementation from the stream. This is both
an input and an output parameter; on entry, any data in the an input and an output parameter; on entry, any data in the
dynamic buffer's input sequence will be given to the parser dynamic buffer's input sequence will be given to the parser
@@ -395,7 +395,7 @@ template<
void void
read( read(
SyncReadStream& stream, SyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
message<isRequest, Body, Fields>& msg); message<isRequest, Body, Fields>& msg);
/** Read a HTTP/1 message from a stream. /** 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. @param stream The stream from which the data is to be read.
The type must support the @b SyncReadStream concept. 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 read by the implementation from the stream. This is both
an input and an output parameter; on entry, any data in the an input and an output parameter; on entry, any data in the
dynamic buffer's input sequence will be given to the parser dynamic buffer's input sequence will be given to the parser
@@ -441,7 +441,7 @@ template<
void void
read( read(
SyncReadStream& stream, SyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
message<isRequest, Body, Fields>& msg, message<isRequest, Body, Fields>& msg,
error_code& ec); error_code& ec);
@@ -472,7 +472,7 @@ read(
@param stream The stream to read the message from. @param stream The stream to read the message from.
The type must support the @b AsyncReadStream concept. 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 read by the implementation from the stream. This is both
an input and an output parameter; on entry, any data in the an input and an output parameter; on entry, any data in the
dynamic buffer's input sequence will be given to the parser dynamic buffer's input sequence will be given to the parser
@@ -503,7 +503,7 @@ async_return_type<
ReadHandler, void(error_code)> ReadHandler, void(error_code)>
async_read( async_read(
AsyncReadStream& stream, AsyncReadStream& stream,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
message<isRequest, Body, Fields>& msg, message<isRequest, Body, Fields>& msg,
ReadHandler&& handler); ReadHandler&& handler);

View File

@@ -356,7 +356,7 @@ template<class InflateStream, class DynamicBuffer>
void void
inflate( inflate(
InflateStream& zi, InflateStream& zi,
DynamicBuffer& dynabuf, DynamicBuffer& buffer,
boost::asio::const_buffer const& in, boost::asio::const_buffer const& in,
error_code& ec) error_code& ec)
{ {
@@ -368,13 +368,13 @@ inflate(
for(;;) for(;;)
{ {
// VFALCO we could be smarter about the size // VFALCO we could be smarter about the size
auto const bs = dynabuf.prepare( auto const bs = buffer.prepare(
read_size_helper(dynabuf, 65536)); read_size_helper(buffer, 65536));
auto const out = *bs.begin(); auto const out = *bs.begin();
zs.avail_out = buffer_size(out); zs.avail_out = buffer_size(out);
zs.next_out = buffer_cast<void*>(out); zs.next_out = buffer_cast<void*>(out);
zi.write(zs, zlib::Flush::sync, ec); zi.write(zs, zlib::Flush::sync, ec);
dynabuf.commit(zs.total_out); buffer.commit(zs.total_out);
zs.total_out = 0; zs.total_out = 0;
if( ec == zlib::error::need_buffers || if( ec == zlib::error::need_buffers ||
ec == zlib::error::end_of_stream) ec == zlib::error::end_of_stream)

View File

@@ -689,7 +689,7 @@ async_return_type<
ReadHandler, void(error_code)> ReadHandler, void(error_code)>
stream<NextLayer>:: stream<NextLayer>::
async_read_frame(frame_info& fi, async_read_frame(frame_info& fi,
DynamicBuffer& dynabuf, ReadHandler&& handler) DynamicBuffer& buffer, ReadHandler&& handler)
{ {
static_assert(is_async_stream<next_layer_type>::value, static_assert(is_async_stream<next_layer_type>::value,
"AsyncStream requirements requirements not met"); "AsyncStream requirements requirements not met");
@@ -699,7 +699,7 @@ async_read_frame(frame_info& fi,
void(error_code)> init{handler}; void(error_code)> init{handler};
read_frame_op<DynamicBuffer, handler_type< read_frame_op<DynamicBuffer, handler_type<
ReadHandler, void(error_code)>>{init.completion_handler, ReadHandler, void(error_code)>>{init.completion_handler,
*this, fi, dynabuf}; *this, fi, buffer};
return init.result.get(); return init.result.get();
} }
@@ -707,14 +707,14 @@ template<class NextLayer>
template<class DynamicBuffer> template<class DynamicBuffer>
void void
stream<NextLayer>:: 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, static_assert(is_sync_stream<next_layer_type>::value,
"SyncStream requirements not met"); "SyncStream requirements not met");
static_assert(beast::is_dynamic_buffer<DynamicBuffer>::value, static_assert(beast::is_dynamic_buffer<DynamicBuffer>::value,
"DynamicBuffer requirements not met"); "DynamicBuffer requirements not met");
error_code ec; error_code ec;
read_frame(fi, dynabuf, ec); read_frame(fi, buffer, ec);
if(ec) if(ec)
throw system_error{ec}; throw system_error{ec};
} }
@@ -1101,7 +1101,7 @@ async_return_type<
ReadHandler, void(error_code)> ReadHandler, void(error_code)>
stream<NextLayer>:: stream<NextLayer>::
async_read(opcode& op, async_read(opcode& op,
DynamicBuffer& dynabuf, ReadHandler&& handler) DynamicBuffer& buffer, ReadHandler&& handler)
{ {
static_assert(is_async_stream<next_layer_type>::value, static_assert(is_async_stream<next_layer_type>::value,
"AsyncStream requirements requirements not met"); "AsyncStream requirements requirements not met");
@@ -1111,7 +1111,7 @@ async_read(opcode& op,
void(error_code)> init{handler}; void(error_code)> init{handler};
read_op<DynamicBuffer, handler_type< read_op<DynamicBuffer, handler_type<
ReadHandler, void(error_code)>>{init.completion_handler, ReadHandler, void(error_code)>>{init.completion_handler,
*this, op, dynabuf}; *this, op, buffer};
return init.result.get(); return init.result.get();
} }
@@ -1119,14 +1119,14 @@ template<class NextLayer>
template<class DynamicBuffer> template<class DynamicBuffer>
void void
stream<NextLayer>:: stream<NextLayer>::
read(opcode& op, DynamicBuffer& dynabuf) read(opcode& op, DynamicBuffer& buffer)
{ {
static_assert(is_sync_stream<next_layer_type>::value, static_assert(is_sync_stream<next_layer_type>::value,
"SyncStream requirements not met"); "SyncStream requirements not met");
static_assert(beast::is_dynamic_buffer<DynamicBuffer>::value, static_assert(beast::is_dynamic_buffer<DynamicBuffer>::value,
"DynamicBuffer requirements not met"); "DynamicBuffer requirements not met");
error_code ec; error_code ec;
read(op, dynabuf, ec); read(op, buffer, ec);
if(ec) if(ec)
throw system_error{ec}; throw system_error{ec};
} }
@@ -1135,7 +1135,7 @@ template<class NextLayer>
template<class DynamicBuffer> template<class DynamicBuffer>
void void
stream<NextLayer>:: 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, static_assert(is_sync_stream<next_layer_type>::value,
"SyncStream requirements not met"); "SyncStream requirements not met");
@@ -1144,7 +1144,7 @@ read(opcode& op, DynamicBuffer& dynabuf, error_code& ec)
frame_info fi; frame_info fi;
for(;;) for(;;)
{ {
read_frame(fi, dynabuf, ec); read_frame(fi, buffer, ec);
if(ec) if(ec)
break; break;
op = fi.op; op = fi.op;

View File

@@ -2351,14 +2351,14 @@ public:
@param op A value to receive the message type. @param op A value to receive the message type.
This object must remain valid until the handler is called. 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. any masking or decompression has been applied.
@throws system_error Thrown on failure. @throws system_error Thrown on failure.
*/ */
template<class DynamicBuffer> template<class DynamicBuffer>
void void
read(opcode& op, DynamicBuffer& dynabuf); read(opcode& op, DynamicBuffer& buffer);
/** Read a message from the stream. /** Read a message from the stream.
@@ -2391,14 +2391,14 @@ public:
@param op A value to receive the message type. @param op A value to receive the message type.
This object must remain valid until the handler is called. 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. any masking or decompression has been applied.
@param ec Set to indicate what error occurred, if any. @param ec Set to indicate what error occurred, if any.
*/ */
template<class DynamicBuffer> template<class DynamicBuffer>
void 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. /** 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. @param op A value to receive the message type.
This object must remain valid until the handler is called. 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 any masking or decompression has been applied. This object must
remain valid until the handler is called. remain valid until the handler is called.
@@ -2462,7 +2462,7 @@ public:
template<class DynamicBuffer, class ReadHandler> template<class DynamicBuffer, class ReadHandler>
async_return_type< async_return_type<
ReadHandler, void(error_code)> 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. /** Read a message frame from the stream.
@@ -2498,14 +2498,14 @@ public:
@param fi An object to store metadata about the message. @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. any masking or decompression has been applied.
@throws system_error Thrown on failure. @throws system_error Thrown on failure.
*/ */
template<class DynamicBuffer> template<class DynamicBuffer>
void void
read_frame(frame_info& fi, DynamicBuffer& dynabuf); read_frame(frame_info& fi, DynamicBuffer& buffer);
/** Read a message frame from the stream. /** Read a message frame from the stream.
@@ -2541,14 +2541,14 @@ public:
@param fi An object to store metadata about the message. @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. any masking or decompression has been applied.
@param ec Set to indicate what error occurred, if any. @param ec Set to indicate what error occurred, if any.
*/ */
template<class DynamicBuffer> template<class DynamicBuffer>
void 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. /** 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. @param fi An object to store metadata about the message.
This object must remain valid until the handler is called. 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 any masking or decompression has been applied. This object must
remain valid until the handler is called. remain valid until the handler is called.
@@ -2617,7 +2617,7 @@ public:
async_return_type< async_return_type<
ReadHandler, void(error_code)> ReadHandler, void(error_code)>
async_read_frame(frame_info& fi, async_read_frame(frame_info& fi,
DynamicBuffer& dynabuf, ReadHandler&& handler); DynamicBuffer& buffer, ReadHandler&& handler);
/** Write a message to the stream. /** Write a message to the stream.

View File

@@ -37,12 +37,12 @@ public:
beast::test::string_istream ss{get_io_service(), s}; beast::test::string_istream ss{get_io_service(), s};
error_code ec; error_code ec;
#if 0 #if 0
multi_buffer dynabuf; multi_buffer buffer;
#else #else
flat_buffer dynabuf{1024}; flat_buffer buffer{1024};
#endif #endif
message<isRequest, string_body, fields> m; message<isRequest, string_body, fields> m;
read(ss, dynabuf, m, ec); read(ss, buffer, m, ec);
if(! BEAST_EXPECTS(! ec, ec.message())) if(! BEAST_EXPECTS(! ec, ec.message()))
return; return;
pred(m); pred(m);

View File

@@ -263,9 +263,9 @@ public:
class NextLayer, class DynamicBuffer> class NextLayer, class DynamicBuffer>
void void
read(stream<NextLayer>& ws, read(stream<NextLayer>& ws,
opcode& op, DynamicBuffer& dynabuf) const opcode& op, DynamicBuffer& buffer) const
{ {
ws.read(op, dynabuf); ws.read(op, buffer);
} }
template< template<
@@ -499,10 +499,10 @@ public:
class NextLayer, class DynamicBuffer> class NextLayer, class DynamicBuffer>
void void
read(stream<NextLayer>& ws, read(stream<NextLayer>& ws,
opcode& op, DynamicBuffer& dynabuf) const opcode& op, DynamicBuffer& buffer) const
{ {
error_code ec; error_code ec;
ws.async_read(op, dynabuf, yield_[ec]); ws.async_read(op, buffer, yield_[ec]);
if(ec) if(ec)
throw system_error{ec}; throw system_error{ec};
} }