Add preliminary support for Boost 1.74

This commit is contained in:
seelabs
2020-07-22 22:09:44 -04:00
committed by Nik Bougalis
parent 8cf542abb0
commit 80860fa8f5
5 changed files with 21 additions and 10 deletions

View File

@@ -360,7 +360,11 @@ OverlayImpl::makeRedirectResponse(
msg.version(request.version());
msg.result(boost::beast::http::status::service_unavailable);
msg.insert("Server", BuildInfo::getFullVersionString());
msg.insert("Remote-Address", remote_address);
{
std::ostringstream ostr;
ostr << remote_address;
msg.insert("Remote-Address", ostr.str());
}
msg.insert("Content-Type", "application/json");
msg.insert(boost::beast::http::field::connection, "close");
msg.body() = Json::objectValue;

View File

@@ -198,13 +198,14 @@ BaseWSPeer<Handler, Impl>::run()
impl().ws_.control_callback(control_callback_);
start_timer();
close_on_timer_ = true;
impl().ws_.async_accept_ex(
request_,
[](auto& res) {
impl().ws_.set_option(
boost::beast::websocket::stream_base::decorator([](auto& res) {
res.set(
boost::beast::http::field::server,
BuildInfo::getFullVersionString());
},
}));
impl().ws_.async_accept(
request_,
bind_executor(
strand_,
std::bind(