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
* Adjust benchmarks
* Initialize local variable in basic_parser
* Fixes for gcc-4.8
HTTP:

View File

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

View File

@@ -99,7 +99,7 @@ private:
// 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,
beast::error_code& ec) const
{
@@ -109,7 +109,7 @@ private:
res.set(http::field::connection, "close");
res.body.open(full_path, "rb", ec);
if(ec)
return boost::none;
return res;
res.set(beast::http::field::content_length, res.body.size());
return res;
}
@@ -146,7 +146,7 @@ private:
else if(ec)
http::write(sock_, server_error(file_ec), ec);
else
http::write(sock_, std::move(*res), ec);
http::write(sock_, std::move(res), ec);
}
void

View File

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