Silence gcc-8 warning:

The warning was caused by a false positive triggered by boost::optional.
Reference:
https://github.com/boostorg/optional/issues/72

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
Damian Jarek
2019-04-21 00:57:20 +02:00
parent 7a388b7da6
commit dbadb79a75
2 changed files with 11 additions and 9 deletions

View File

@ -3,6 +3,7 @@ Version 254:
* Fix data race in test::stream::connect
* Fix UB in websocket close tests
* Fix uninitalized memory use in deflate_stream
* Fix gcc-8 warning in websocket::stream
--------------------------------------------------------------------------------

View File

@ -664,21 +664,22 @@ public:
auto& impl = *sp;
using mutable_buffers_type = typename
DynamicBuffer::mutable_buffers_type;
boost::optional<mutable_buffers_type> mb;
BOOST_ASIO_CORO_REENTER(*this)
{
do
{
mb = beast::detail::dynamic_buffer_prepare(b_,
clamp(impl.read_size_hint_db(b_), limit_),
ec, error::buffer_overflow);
if(impl.check_stop_now(ec))
goto upcall;
// VFALCO TODO use boost::beast::bind_continuation
BOOST_ASIO_CORO_YIELD
read_some_op<read_op, mutable_buffers_type>(
std::move(*this), sp, *mb);
{
auto mb = beast::detail::dynamic_buffer_prepare(b_,
clamp(impl.read_size_hint_db(b_), limit_),
ec, error::buffer_overflow);
if(impl.check_stop_now(ec))
goto upcall;
read_some_op<read_op, mutable_buffers_type>(
std::move(*this), sp, *mb);
}
b_.commit(bytes_transferred);
bytes_written_ += bytes_transferred;
if(ec)