mirror of
https://github.com/boostorg/beast.git
synced 2025-07-29 20:37:31 +02:00
Tidy up namespace qualifiers
This commit is contained in:
@ -3,6 +3,7 @@ Version 91:
|
||||
* Adjust redirect html
|
||||
* Don't build pre-C++11
|
||||
* source.dox is path-independent
|
||||
* Tidy up namespace qualifiers
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace system {
|
||||
template<>
|
||||
struct is_error_code_enum<beast::http::error>
|
||||
@ -20,9 +21,7 @@ struct is_error_code_enum<beast::http::error>
|
||||
static bool const value = true;
|
||||
};
|
||||
} // system
|
||||
} // boost
|
||||
|
||||
namespace boost {
|
||||
namespace beast {
|
||||
namespace http {
|
||||
namespace detail {
|
||||
|
@ -11,6 +11,7 @@
|
||||
#define BOOST_BEAST_WEBSOCKET_IMPL_ERROR_IPP
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace system {
|
||||
template<>
|
||||
struct is_error_code_enum<beast::websocket::error>
|
||||
@ -18,9 +19,7 @@ struct is_error_code_enum<beast::websocket::error>
|
||||
static bool const value = true;
|
||||
};
|
||||
} // system
|
||||
} // boost
|
||||
|
||||
namespace boost {
|
||||
namespace beast {
|
||||
namespace websocket {
|
||||
namespace detail {
|
||||
|
@ -38,12 +38,12 @@ namespace websocket {
|
||||
@code
|
||||
void handle_connection(boost::asio::ip::tcp::socket& sock)
|
||||
{
|
||||
beast::flat_buffer buffer;
|
||||
beast::http::request<beast::http::string_body> req;
|
||||
beast::http::read(sock, buffer, req);
|
||||
if(beast::websocket::is_upgrade(req))
|
||||
boost::beast::flat_buffer buffer;
|
||||
boost::beast::http::request<boost::beast::http::string_body> req;
|
||||
boost::beast::http::read(sock, buffer, req);
|
||||
if(boost::beast::websocket::is_upgrade(req))
|
||||
{
|
||||
beast::websocket::stream<decltype(sock)> ws{std::move(sock)};
|
||||
boost::beast::websocket::stream<decltype(sock)> ws{std::move(sock)};
|
||||
ws.accept(req);
|
||||
}
|
||||
}
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace system {
|
||||
template<>
|
||||
struct is_error_code_enum<beast::zlib::error>
|
||||
@ -48,9 +49,7 @@ struct is_error_code_enum<beast::zlib::error>
|
||||
static bool const value = true;
|
||||
};
|
||||
} // system
|
||||
} // boost
|
||||
|
||||
namespace boost {
|
||||
namespace beast {
|
||||
namespace zlib {
|
||||
namespace detail {
|
||||
|
@ -70,22 +70,22 @@ public:
|
||||
void
|
||||
doOptions(Stream& stream, error_code& ec)
|
||||
{
|
||||
beast::http::request<beast::http::empty_body> req;
|
||||
http::request<http::empty_body> req;
|
||||
req.version = 11;
|
||||
req.method(beast::http::verb::options);
|
||||
req.method(http::verb::options);
|
||||
req.target("*");
|
||||
req.set(beast::http::field::user_agent, "test");
|
||||
req.set(beast::http::field::connection, "close");
|
||||
req.set(http::field::user_agent, "test");
|
||||
req.set(http::field::connection, "close");
|
||||
|
||||
beast::http::write(stream, req, ec);
|
||||
http::write(stream, req, ec);
|
||||
if(! BEAST_EXPECTS(
|
||||
ec == beast::http::error::end_of_stream,
|
||||
ec == http::error::end_of_stream,
|
||||
ec.message()))
|
||||
return;
|
||||
|
||||
beast::flat_buffer b;
|
||||
beast::http::response<beast::http::string_body> res;
|
||||
beast::http::read(stream, b, res, ec);
|
||||
http::response<http::string_body> res;
|
||||
http::read(stream, b, res, ec);
|
||||
if(! BEAST_EXPECTS(! ec, ec.message()))
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user