forked from boostorg/beast
Fixes to support Asio changes (API Change):
This adjusts Beast's interfaces and implementation to match the changes in Boost.Asio.
This commit is contained in:
1 parent
ac24e58fb3
commit
6baa607295
58 files changed
+762
-723
No files matched your search
@@ -207,11 +207,6 @@ handle_request(
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// The type of stream to use
|
||||
// Stackful coroutines are already stranded.
|
||||
using stream_type =
|
||||
beast::ssl_stream<beast::tcp_stream<net::io_context::executor_type>>;
|
||||
|
||||
// Report a failure
|
||||
void
|
||||
fail(beast::error_code ec, char const* what)
|
||||
@@ -223,13 +218,13 @@ fail(beast::error_code ec, char const* what)
|
||||
// The function object is used to send an HTTP message.
|
||||
struct send_lambda
|
||||
{
|
||||
stream_type& stream_;
|
||||
beast::ssl_stream<beast::tcp_stream>& stream_;
|
||||
bool& close_;
|
||||
beast::error_code& ec_;
|
||||
net::yield_context yield_;
|
||||
|
||||
send_lambda(
|
||||
stream_type& stream,
|
||||
beast::ssl_stream<beast::tcp_stream>& stream,
|
||||
bool& close,
|
||||
beast::error_code& ec,
|
||||
net::yield_context yield)
|
||||
@@ -258,7 +253,7 @@ struct send_lambda
|
||||
// Handles an HTTP server connection
|
||||
void
|
||||
do_session(
|
||||
stream_type& stream,
|
||||
beast::ssl_stream<beast::tcp_stream>& stream,
|
||||
std::shared_ptr<std::string const> const& doc_root,
|
||||
net::yield_context yield)
|
||||
{
|
||||
@@ -357,10 +352,11 @@ do_listen(
|
||||
fail(ec, "accept");
|
||||
else
|
||||
net::spawn(
|
||||
acceptor.get_executor().context(),
|
||||
acceptor.get_executor(),
|
||||
std::bind(
|
||||
&do_session,
|
||||
stream_type(std::move(socket), ctx),
|
||||
beast::ssl_stream<beast::tcp_stream>(
|
||||
std::move(socket), ctx),
|
||||
doc_root,
|
||||
std::placeholders::_1));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user