mirror of
https://github.com/boostorg/beast.git
synced 2025-07-30 21:07:26 +02:00
SSL teardowns are in an associated namespace
This commit is contained in:
@ -5,6 +5,7 @@ Version 228:
|
|||||||
* The Fields concept is deprecated (API Change)
|
* The Fields concept is deprecated (API Change)
|
||||||
* Fix includes.xsl for newer doxygen
|
* Fix includes.xsl for newer doxygen
|
||||||
* Tidy up quick reference
|
* Tidy up quick reference
|
||||||
|
* SSL teardowns are in an associated namespace
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace beast {
|
namespace beast {
|
||||||
namespace websocket {
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
@ -54,7 +53,6 @@ async_teardown(
|
|||||||
std::forward<TeardownHandler>(handler));
|
std::forward<TeardownHandler>(handler));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // websocket
|
|
||||||
} // beast
|
} // beast
|
||||||
} // boost
|
} // boost
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace beast {
|
namespace beast {
|
||||||
namespace websocket {
|
|
||||||
|
|
||||||
/** Tear down a `net::ssl::stream`.
|
/** Tear down a `net::ssl::stream`.
|
||||||
|
|
||||||
@ -79,7 +78,6 @@ async_teardown(
|
|||||||
net::ssl::stream<AsyncStream>& stream,
|
net::ssl::stream<AsyncStream>& stream,
|
||||||
TeardownHandler&& handler);
|
TeardownHandler&& handler);
|
||||||
|
|
||||||
} // websocket
|
|
||||||
} // beast
|
} // beast
|
||||||
} // boost
|
} // boost
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ add_executable (tests-beast-websocket
|
|||||||
read2.cpp
|
read2.cpp
|
||||||
read3.cpp
|
read3.cpp
|
||||||
rfc6455.cpp
|
rfc6455.cpp
|
||||||
|
ssl.cpp
|
||||||
stream.cpp
|
stream.cpp
|
||||||
stream_base.cpp
|
stream_base.cpp
|
||||||
stream_explicit.cpp
|
stream_explicit.cpp
|
||||||
|
@ -22,6 +22,7 @@ local SOURCES =
|
|||||||
read2.cpp
|
read2.cpp
|
||||||
read3.cpp
|
read3.cpp
|
||||||
rfc6455.cpp
|
rfc6455.cpp
|
||||||
|
ssl.cpp
|
||||||
stream.cpp
|
stream.cpp
|
||||||
stream_base.cpp
|
stream_base.cpp
|
||||||
stream_explicit.cpp
|
stream_explicit.cpp
|
||||||
|
74
test/beast/websocket/ssl.cpp
Normal file
74
test/beast/websocket/ssl.cpp
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
//
|
||||||
|
// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
|
||||||
|
//
|
||||||
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
//
|
||||||
|
// Official repository: https://github.com/boostorg/beast
|
||||||
|
//
|
||||||
|
|
||||||
|
// VFALCO This causes a compilation error
|
||||||
|
#include <boost/beast/websocket/stream.hpp>
|
||||||
|
|
||||||
|
// Test that header file is self-contained.
|
||||||
|
#include <boost/beast/websocket/ssl.hpp>
|
||||||
|
|
||||||
|
#include <boost/beast/websocket/stream.hpp>
|
||||||
|
#include <boost/beast/_experimental/unit_test/suite.hpp>
|
||||||
|
#include <boost/asio/executor.hpp>
|
||||||
|
#include <boost/asio/ip/tcp.hpp>
|
||||||
|
#include <boost/asio/ssl.hpp>
|
||||||
|
|
||||||
|
namespace boost {
|
||||||
|
namespace beast {
|
||||||
|
namespace websocket {
|
||||||
|
|
||||||
|
class ssl_test : public unit_test::suite
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
template<class Socket>
|
||||||
|
void
|
||||||
|
testTeardown()
|
||||||
|
{
|
||||||
|
net::io_context ioc;
|
||||||
|
net::ssl::context ctx(net::ssl::context::sslv23);
|
||||||
|
Socket ss(ioc, ctx);
|
||||||
|
|
||||||
|
struct handler
|
||||||
|
{
|
||||||
|
void
|
||||||
|
operator()(error_code)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
websocket::stream<Socket> ws(ioc, ctx);
|
||||||
|
|
||||||
|
BEAST_EXPECT(static_cast<
|
||||||
|
void(websocket::stream<Socket>::*)(
|
||||||
|
close_reason const&)>(
|
||||||
|
&websocket::stream<Socket>::close));
|
||||||
|
|
||||||
|
BEAST_EXPECT(static_cast<
|
||||||
|
void(websocket::stream<Socket>::*)(
|
||||||
|
close_reason const&, error_code&)>(
|
||||||
|
&websocket::stream<Socket>::close));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
run() override
|
||||||
|
{
|
||||||
|
testTeardown<
|
||||||
|
boost::asio::ssl::stream<
|
||||||
|
boost::asio::basic_stream_socket<
|
||||||
|
boost::asio::ip::tcp,
|
||||||
|
boost::asio::executor>>>();
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
BEAST_DEFINE_TESTSUITE(beast,websocket,ssl);
|
||||||
|
|
||||||
|
} // websocket
|
||||||
|
} // beast
|
||||||
|
} // boost
|
Reference in New Issue
Block a user