]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/beast/websocket/impl/ssl.ipp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / beast / websocket / impl / ssl.ipp
1 //
2 // Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // Official repository: https://github.com/boostorg/beast
8 //
9
10 #ifndef BOOST_BEAST_WEBSOCKET_IMPL_SSL_IPP_INCLUDED
11 #define BOOST_BEAST_WEBSOCKET_IMPL_SSL_IPP_INCLUDED
12
13 #include <utility>
14
15 namespace boost {
16 namespace beast {
17 namespace websocket {
18
19 /*
20
21 See
22 http://stackoverflow.com/questions/32046034/what-is-the-proper-way-to-securely-disconnect-an-asio-ssl-socket/32054476#32054476
23
24 Behavior of ssl::stream regarding close_
25
26 If the remote host calls async_shutdown then the
27 local host's async_read will complete with eof.
28
29 If both hosts call async_shutdown then the calls
30 to async_shutdown will complete with eof.
31
32 */
33
34 template<class AsyncStream>
35 void
36 teardown(
37 role_type,
38 boost::asio::ssl::stream<AsyncStream>& stream,
39 error_code& ec)
40 {
41 stream.shutdown(ec);
42 }
43
44 template<
45 class AsyncStream,
46 class TeardownHandler>
47 void
48 async_teardown(
49 role_type,
50 boost::asio::ssl::stream<AsyncStream>& stream,
51 TeardownHandler&& handler)
52 {
53 stream.async_shutdown(
54 std::forward<TeardownHandler>(handler));
55 }
56
57 } // websocket
58 } // beast
59 } // boost
60
61 #endif