forked from boostorg/beast
1 parent
a94efc8c92
commit
f48b978044
12 files changed
+65
-64
No files matched your search
@@ -256,7 +256,7 @@ void
|
||||
do_session(
|
||||
tcp::socket& socket,
|
||||
ssl::context& ctx,
|
||||
std::string const& doc_root,
|
||||
std::shared_ptr<std::string const> const& doc_root,
|
||||
boost::asio::yield_context yield)
|
||||
{
|
||||
bool close = false;
|
||||
@@ -287,7 +287,7 @@ do_session(
|
||||
return fail(ec, "read");
|
||||
|
||||
// Send the response
|
||||
handle_request(doc_root, std::move(req), lambda);
|
||||
handle_request(*doc_root, std::move(req), lambda);
|
||||
if(ec)
|
||||
return fail(ec, "write");
|
||||
if(close)
|
||||
@@ -314,7 +314,7 @@ do_listen(
|
||||
boost::asio::io_context& ioc,
|
||||
ssl::context& ctx,
|
||||
tcp::endpoint endpoint,
|
||||
std::string const& doc_root,
|
||||
std::shared_ptr<std::string const> const& doc_root,
|
||||
boost::asio::yield_context yield)
|
||||
{
|
||||
boost::system::error_code ec;
|
||||
@@ -371,7 +371,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
auto const address = boost::asio::ip::make_address(argv[1]);
|
||||
auto const port = static_cast<unsigned short>(std::atoi(argv[2]));
|
||||
std::string const doc_root = argv[3];
|
||||
auto const doc_root = std::make_shared<std::string>(argv[3]);
|
||||
auto const threads = std::max<int>(1, std::atoi(argv[4]));
|
||||
|
||||
// The io_context is required for all I/O
|
||||
|
||||
Reference in new issue
Block a user