Fixes for gcc-4.8

This commit is contained in:
Vinnie Falco
2017-07-05 12:04:10 -07:00
parent abdd89fde8
commit 37461a1c4c
4 changed files with 9 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ Version 73:
* Verify certificates in SSL clients * Verify certificates in SSL clients
* Adjust benchmarks * Adjust benchmarks
* Initialize local variable in basic_parser * Initialize local variable in basic_parser
* Fixes for gcc-4.8
HTTP: HTTP:

View File

@@ -73,7 +73,7 @@ private:
void void
read_request() read_request()
{ {
auto self{shared_from_this()}; auto self = shared_from_this();
http::async_read( http::async_read(
socket_, socket_,
@@ -160,7 +160,7 @@ private:
void void
write_response() write_response()
{ {
auto self{shared_from_this()}; auto self = shared_from_this();
response_.set(http::field::content_length, response_.body.size()); response_.set(http::field::content_length, response_.body.size());
@@ -178,7 +178,7 @@ private:
void void
check_deadline() check_deadline()
{ {
auto self{shared_from_this()}; auto self = shared_from_this();
deadline_.async_wait( deadline_.async_wait(
[self](beast::error_code ec) [self](beast::error_code ec)

View File

@@ -99,7 +99,7 @@ private:
// Return a file response to an HTTP GET request // Return a file response to an HTTP GET request
// //
boost::optional<beast::http::response<file_body>> beast::http::response<file_body>
get(boost::filesystem::path const& full_path, get(boost::filesystem::path const& full_path,
beast::error_code& ec) const beast::error_code& ec) const
{ {
@@ -109,7 +109,7 @@ private:
res.set(http::field::connection, "close"); res.set(http::field::connection, "close");
res.body.open(full_path, "rb", ec); res.body.open(full_path, "rb", ec);
if(ec) if(ec)
return boost::none; return res;
res.set(beast::http::field::content_length, res.body.size()); res.set(beast::http::field::content_length, res.body.size());
return res; return res;
} }
@@ -146,7 +146,7 @@ private:
else if(ec) else if(ec)
http::write(sock_, server_error(file_ec), ec); http::write(sock_, server_error(file_ec), ec);
else else
http::write(sock_, std::move(*res), ec); http::write(sock_, std::move(res), ec);
} }
void void

View File

@@ -247,7 +247,7 @@ private:
if(ec) if(ec)
return boost::none; return boost::none;
res.set(beast::http::field::content_length, res.body.size()); res.set(beast::http::field::content_length, res.body.size());
return res; return {std::move(res)};
} }
// Return a response to an HTTP HEAD request // Return a response to an HTTP HEAD request
@@ -270,7 +270,7 @@ private:
if(ec) if(ec)
return boost::none; return boost::none;
res.set(beast::http::field::content_length, body.size()); res.set(beast::http::field::content_length, body.size());
return res; return {std::move(res)};
} }
}; };