mirror of
https://github.com/boostorg/beast.git
synced 2025-08-03 14:54:32 +02:00
Fix stream::read_size_hint calculation
This commit is contained in:
@@ -13,6 +13,7 @@ WebSocket:
|
||||
* Refactor fail/clode code
|
||||
* Call do_fail from read_some
|
||||
* eof on accept returns error::closed
|
||||
* Fix stream::read_size_hint calculation
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
@@ -98,8 +98,11 @@ read_size_hint(
|
||||
buffer.max_size(), clamp(rd_.remain));
|
||||
}
|
||||
}
|
||||
return (std::min)(buffer.max_size(), (std::max)(
|
||||
(std::max)(+tcp_frame_size, clamp(rd_.remain)),
|
||||
return (std::min)(
|
||||
buffer.max_size() - buffer.size(),
|
||||
(std::max)((std::max)(
|
||||
+tcp_frame_size,
|
||||
clamp(rd_.remain)),
|
||||
buffer.capacity() - buffer.size()));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user