mirror of
https://github.com/boostorg/beast.git
synced 2025-07-31 05:17:26 +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:
|
Version 260:
|
||||||
|
|
||||||
* More split compilation in rfc7230.hpp
|
* More split compilation in rfc7230.hpp
|
||||||
|
@ -138,12 +138,7 @@ read_size_hint(DynamicBuffer& buffer) const
|
|||||||
static_assert(
|
static_assert(
|
||||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||||
"DynamicBuffer type requirements not met");
|
"DynamicBuffer type requirements not met");
|
||||||
auto const initial_size = (std::min)(
|
return impl_->read_size_hint_db(buffer);
|
||||||
+tcp_frame_size,
|
|
||||||
buffer.max_size() - buffer.size());
|
|
||||||
if(initial_size == 0)
|
|
||||||
return 1; // buffer is full
|
|
||||||
return read_size_hint(initial_size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
@ -274,13 +274,6 @@ struct stream<NextLayer, deflateSupported>::impl_type
|
|||||||
return key;
|
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>
|
template<class DynamicBuffer>
|
||||||
std::size_t
|
std::size_t
|
||||||
read_size_hint_db(DynamicBuffer& buffer) const
|
read_size_hint_db(DynamicBuffer& buffer) const
|
||||||
@ -290,7 +283,8 @@ struct stream<NextLayer, deflateSupported>::impl_type
|
|||||||
buffer.max_size() - buffer.size());
|
buffer.max_size() - buffer.size());
|
||||||
if(initial_size == 0)
|
if(initial_size == 0)
|
||||||
return 1; // buffer is full
|
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>
|
template<class DynamicBuffer>
|
||||||
|
Reference in New Issue
Block a user