mirror of
https://github.com/boostorg/beast.git
synced 2025-07-31 05:17:26 +02:00
Fix ssl_stream teardown
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
Version 240:
|
||||||
|
|
||||||
|
* Fix ssl_stream teardown
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
Version 239:
|
Version 239:
|
||||||
|
|
||||||
* More split compilation in HTTP
|
* More split compilation in HTTP
|
||||||
|
@ -644,38 +644,40 @@ public:
|
|||||||
return p_->async_read_some(buffers,
|
return p_->async_read_some(buffers,
|
||||||
BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
|
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
|
} // beast
|
||||||
} // boost
|
} // boost
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user