SSL teardowns are in an associated namespace

This commit is contained in:
Vinnie Falco
2019-03-04 17:25:50 -08:00
parent 7f5a405e61
commit e4342b51b2
6 changed files with 77 additions and 4 deletions

View File

@ -5,6 +5,7 @@ Version 228:
* The Fields concept is deprecated (API Change)
* Fix includes.xsl for newer doxygen
* Tidy up quick reference
* SSL teardowns are in an associated namespace
--------------------------------------------------------------------------------

View File

@ -14,7 +14,6 @@
namespace boost {
namespace beast {
namespace websocket {
/*
@ -54,7 +53,6 @@ async_teardown(
std::forward<TeardownHandler>(handler));
}
} // websocket
} // beast
} // boost

View File

@ -17,7 +17,6 @@
namespace boost {
namespace beast {
namespace websocket {
/** Tear down a `net::ssl::stream`.
@ -79,7 +78,6 @@ async_teardown(
net::ssl::stream<AsyncStream>& stream,
TeardownHandler&& handler);
} // websocket
} // beast
} // boost

View File

@ -32,6 +32,7 @@ add_executable (tests-beast-websocket
read2.cpp
read3.cpp
rfc6455.cpp
ssl.cpp
stream.cpp
stream_base.cpp
stream_explicit.cpp

View File

@ -22,6 +22,7 @@ local SOURCES =
read2.cpp
read3.cpp
rfc6455.cpp
ssl.cpp
stream.cpp
stream_base.cpp
stream_explicit.cpp

View 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