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

+11 -6
View File
@@ -33,20 +33,25 @@ Behavior of ssl::stream regarding close_
template<class AsyncStream>
void
teardown(teardown_tag,
teardown(
role_type,
boost::asio::ssl::stream<AsyncStream>& stream,
error_code& ec)
error_code& ec)
{
stream.shutdown(ec);
}
template<class AsyncStream, class TeardownHandler>
template<
class AsyncStream,
class TeardownHandler>
void
async_teardown(teardown_tag,
async_teardown(
role_type,
boost::asio::ssl::stream<AsyncStream>& stream,
TeardownHandler&& handler)
TeardownHandler&& handler)
{
stream.async_shutdown(std::forward<TeardownHandler>(handler));
stream.async_shutdown(
std::forward<TeardownHandler>(handler));
}
} // websocket