Fix ssl_stream teardown

This commit is contained in:
Vinnie Falco
2019-03-27 09:13:32 -07:00
parent 2c141cd4ad
commit ed9d861545
2 changed files with 38 additions and 30 deletions

View File

@ -1,3 +1,9 @@
Version 240:
* Fix ssl_stream teardown
--------------------------------------------------------------------------------
Version 239:
* More split compilation in HTTP

View File

@ -644,38 +644,40 @@ public:
return p_->async_read_some(buffers,
BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
}
// These hooks are used to inform boost::beast::websocket::stream on
// how to tear down the connection as part of the WebSocket
// protocol specifications
#if ! BOOST_BEAST_DOXYGEN
template<class SyncStream>
friend
void
teardown(
boost::beast::role_type role,
ssl_stream<SyncStream>& stream,
boost::system::error_code& ec)
{
// Just forward it to the underlying ssl::stream
using boost::beast::websocket::teardown;
teardown(role, *stream.p_, ec);
}
template<class AsyncStream, class TeardownHandler>
friend
void
async_teardown(
boost::beast::role_type role,
ssl_stream<AsyncStream>& stream,
TeardownHandler&& handler)
{
// Just forward it to the underlying ssl::stream
using boost::beast::websocket::async_teardown;
async_teardown(role, *stream.p_,
std::forward<TeardownHandler>(handler));
}
#endif
};
// These hooks are used to inform boost::beast::websocket::stream on
// how to tear down the connection as part of the WebSocket
// protocol specifications
#if ! BOOST_BEAST_DOXYGEN
template<class SyncStream>
void
teardown(
boost::beast::role_type role,
ssl_stream<SyncStream>& stream,
boost::system::error_code& ec)
{
// Just forward it to the wrapped stream
using boost::beast::websocket::teardown;
teardown(role, stream.next_layer(), ec);
}
template<class AsyncStream, class TeardownHandler>
void
async_teardown(
boost::beast::role_type role,
ssl_stream<AsyncStream>& stream,
TeardownHandler&& handler)
{
// Just forward it to the wrapped stream
using boost::beast::websocket::async_teardown;
async_teardown(role,
stream.next_layer(), std::forward<TeardownHandler>(handler));
}
#endif
} // beast
} // boost