forked from boostorg/beast
Fix stream::read_size_hint calculation
This commit is contained in:
@@ -13,6 +13,7 @@ WebSocket:
|
|||||||
* Refactor fail/clode code
|
* Refactor fail/clode code
|
||||||
* Call do_fail from read_some
|
* Call do_fail from read_some
|
||||||
* eof on accept returns error::closed
|
* 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));
|
buffer.max_size(), clamp(rd_.remain));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (std::min)(buffer.max_size(), (std::max)(
|
return (std::min)(
|
||||||
(std::max)(+tcp_frame_size, clamp(rd_.remain)),
|
buffer.max_size() - buffer.size(),
|
||||||
|
(std::max)((std::max)(
|
||||||
|
+tcp_frame_size,
|
||||||
|
clamp(rd_.remain)),
|
||||||
buffer.capacity() - buffer.size()));
|
buffer.capacity() - buffer.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user