mirror of
https://github.com/boostorg/beast.git
synced 2025-07-29 20:37:31 +02:00
Deduplicate websocket::read_size_hint
definition
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
@ -1,3 +1,9 @@
|
||||
Version 261:
|
||||
|
||||
* Deduplicate `websocket::read_size_hint` definition
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Version 260:
|
||||
|
||||
* More split compilation in rfc7230.hpp
|
||||
|
@ -138,12 +138,7 @@ read_size_hint(DynamicBuffer& buffer) const
|
||||
static_assert(
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer type requirements not met");
|
||||
auto const initial_size = (std::min)(
|
||||
+tcp_frame_size,
|
||||
buffer.max_size() - buffer.size());
|
||||
if(initial_size == 0)
|
||||
return 1; // buffer is full
|
||||
return read_size_hint(initial_size);
|
||||
return impl_->read_size_hint_db(buffer);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
@ -274,13 +274,6 @@ struct stream<NextLayer, deflateSupported>::impl_type
|
||||
return key;
|
||||
}
|
||||
|
||||
std::size_t
|
||||
read_size_hint(std::size_t initial_size) const
|
||||
{
|
||||
return this->read_size_hint_pmd(
|
||||
initial_size, rd_done, rd_remain, rd_fh);
|
||||
}
|
||||
|
||||
template<class DynamicBuffer>
|
||||
std::size_t
|
||||
read_size_hint_db(DynamicBuffer& buffer) const
|
||||
@ -290,7 +283,8 @@ struct stream<NextLayer, deflateSupported>::impl_type
|
||||
buffer.max_size() - buffer.size());
|
||||
if(initial_size == 0)
|
||||
return 1; // buffer is full
|
||||
return this->read_size_hint(initial_size);
|
||||
return this->read_size_hint_pmd(
|
||||
initial_size, rd_done, rd_remain, rd_fh);
|
||||
}
|
||||
|
||||
template<class DynamicBuffer>
|
||||
|
Reference in New Issue
Block a user