forked from boostorg/beast
Add rd_close_ to websocket stream state
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
* Documentation tidying
|
* Documentation tidying
|
||||||
* is_invocable works with move-only types
|
* is_invocable works with move-only types
|
||||||
|
|
||||||
|
WebSocket
|
||||||
|
|
||||||
* websocket::stream tidying
|
* websocket::stream tidying
|
||||||
|
* Add rd_close_ to websocket stream state
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -472,6 +472,8 @@ operator()(error_code ec,
|
|||||||
}
|
}
|
||||||
BOOST_ASSERT(d.fh.op == detail::opcode::close);
|
BOOST_ASSERT(d.fh.op == detail::opcode::close);
|
||||||
{
|
{
|
||||||
|
BOOST_ASSERT(! d.ws.rd_close_);
|
||||||
|
d.ws.rd_close_ = true;
|
||||||
detail::read(d.ws.cr_, d.fb.data(), code);
|
detail::read(d.ws.cr_, d.fb.data(), code);
|
||||||
if(code != close_code::none)
|
if(code != close_code::none)
|
||||||
{
|
{
|
||||||
@@ -822,6 +824,8 @@ read_frame(DynamicBuffer& dynabuf, error_code& ec)
|
|||||||
}
|
}
|
||||||
BOOST_ASSERT(fh.op == detail::opcode::close);
|
BOOST_ASSERT(fh.op == detail::opcode::close);
|
||||||
{
|
{
|
||||||
|
BOOST_ASSERT(! rd_close_);
|
||||||
|
rd_close_ = true;
|
||||||
detail::read(cr_, fb.data(), code);
|
detail::read(cr_, fb.data(), code);
|
||||||
if(code != close_code::none)
|
if(code != close_code::none)
|
||||||
goto do_close;
|
goto do_close;
|
||||||
|
@@ -79,6 +79,7 @@ open(role_type role)
|
|||||||
role_ = role;
|
role_ = role;
|
||||||
failed_ = false;
|
failed_ = false;
|
||||||
rd_.cont = false;
|
rd_.cont = false;
|
||||||
|
rd_close_ = false;
|
||||||
wr_close_ = false;
|
wr_close_ = false;
|
||||||
wr_block_ = nullptr; // should be nullptr on close anyway
|
wr_block_ = nullptr; // should be nullptr on close anyway
|
||||||
ping_data_ = nullptr; // should be nullptr on close anyway
|
ping_data_ = nullptr; // should be nullptr on close anyway
|
||||||
@@ -132,6 +133,7 @@ reset()
|
|||||||
{
|
{
|
||||||
failed_ = false;
|
failed_ = false;
|
||||||
rd_.cont = false;
|
rd_.cont = false;
|
||||||
|
rd_close_ = false;
|
||||||
wr_close_ = false;
|
wr_close_ = false;
|
||||||
wr_.cont = false;
|
wr_.cont = false;
|
||||||
wr_block_ = nullptr; // should be nullptr on close anyway
|
wr_block_ = nullptr; // should be nullptr on close anyway
|
||||||
|
@@ -213,6 +213,7 @@ class stream
|
|||||||
role_type role_; // server or client
|
role_type role_; // server or client
|
||||||
bool failed_; // the connection failed
|
bool failed_; // the connection failed
|
||||||
|
|
||||||
|
bool rd_close_; // read close frame
|
||||||
bool wr_close_; // sent close frame
|
bool wr_close_; // sent close frame
|
||||||
op* wr_block_; // op currenly writing
|
op* wr_block_; // op currenly writing
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user