forked from boostorg/beast
Refactor stream operations and tests plus coverage
This commit is contained in:
1 parent
9f089c2a33
commit
51a5a36118
22 files changed
+1290
-354
No files matched your search
@@ -131,7 +131,7 @@ operator()(error_code ec, std::size_t)
|
||||
d.ws.wr_block_ = d.tok;
|
||||
|
||||
// Make sure the stream is open
|
||||
if(d.ws.check_fail(ec))
|
||||
if(! d.ws.check_open(ec))
|
||||
{
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
d.ws.get_io_service().post(
|
||||
@@ -156,7 +156,7 @@ operator()(error_code ec, std::size_t)
|
||||
BOOST_ASSERT(d.ws.wr_block_ == d.tok);
|
||||
|
||||
// Make sure the stream is open
|
||||
if(d.ws.check_fail(ec))
|
||||
if(! d.ws.check_open(ec))
|
||||
goto upcall;
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ operator()(error_code ec, std::size_t)
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::async_write(d.ws.stream_,
|
||||
d.fb.data(), std::move(*this));
|
||||
if(d.ws.check_fail(ec))
|
||||
if(! d.ws.check_ok(ec))
|
||||
goto upcall;
|
||||
|
||||
upcall:
|
||||
@@ -195,15 +195,14 @@ void
|
||||
stream<NextLayer>::
|
||||
ping(ping_data const& payload, error_code& ec)
|
||||
{
|
||||
ec.assign(0, ec.category());
|
||||
// Make sure the stream is open
|
||||
if(check_fail(ec))
|
||||
if(! check_open(ec))
|
||||
return;
|
||||
detail::frame_buffer fb;
|
||||
write_ping<flat_static_buffer_base>(
|
||||
fb, detail::opcode::ping, payload);
|
||||
boost::asio::write(stream_, fb.data(), ec);
|
||||
if(check_fail(ec))
|
||||
if(! check_ok(ec))
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -223,15 +222,14 @@ void
|
||||
stream<NextLayer>::
|
||||
pong(ping_data const& payload, error_code& ec)
|
||||
{
|
||||
ec.assign(0, ec.category());
|
||||
// Make sure the stream is open
|
||||
if(check_fail(ec))
|
||||
if(! check_open(ec))
|
||||
return;
|
||||
detail::frame_buffer fb;
|
||||
write_ping<flat_static_buffer_base>(
|
||||
fb, detail::opcode::pong, payload);
|
||||
boost::asio::write(stream_, fb.data(), ec);
|
||||
if(check_fail(ec))
|
||||
if(! check_ok(ec))
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user