Add teardown_role for correct TIME_WAIT behavior (API Change):

* teardown_tag is replaced with teardown_role, a client/server
  flag used to determine whether the shutdown is performed
  before or after reading the EOF. This is in accordance with
  RFC6455 7.1.1:

  https://tools.ietf.org/html/rfc6455#section-7.1.1

Actions Required:

* Modify signatures of teardown and async_teardown to use
  teardown_role instead of teardown_tag

* Change calls to teardown and async_teardown to pass the
  correct role: client or server depending on context.
This commit is contained in:
Vinnie Falco committed 2017-08-04 19:02:13 -07:00
1 parent de03a1a32d
commit 60c8a560bf
19 files changed
+254 -157

No files matched your search

+4 -2
View File
@@ -180,7 +180,8 @@ operator()(error_code ec, std::size_t)
go_teardown:
BOOST_ASSERT(ws_.wr_block_ == tok_);
step_ = do_teardown + 1;
websocket_helpers::call_async_teardown(
using beast::websocket::async_teardown;
async_teardown(ws_.role_,
ws_.stream_, std::move(*this));
return;
@@ -234,7 +235,8 @@ do_fail(
if(failed_)
return;
}
websocket_helpers::call_teardown(stream_, ec);
using beast::websocket::teardown;
teardown(role_, stream_, ec);
if(ec == boost::asio::error::eof)
{
// Rationale: