diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f0612fb..defe0966 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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: diff --git a/example/http-server-small/http_server_small.cpp b/example/http-server-small/http_server_small.cpp index d0cd0ba9..f73c7734 100644 --- a/example/http-server-small/http_server_small.cpp +++ b/example/http-server-small/http_server_small.cpp @@ -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) diff --git a/example/http-server-threaded/http_server_threaded.cpp b/example/http-server-threaded/http_server_threaded.cpp index 540a261b..310c3412 100644 --- a/example/http-server-threaded/http_server_threaded.cpp +++ b/example/http-server-threaded/http_server_threaded.cpp @@ -99,7 +99,7 @@ private: // Return a file response to an HTTP GET request // - boost::optional> + beast::http::response 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 diff --git a/example/server-framework/file_service.hpp b/example/server-framework/file_service.hpp index 96079081..7110e355 100644 --- a/example/server-framework/file_service.hpp +++ b/example/server-framework/file_service.hpp @@ -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)}; } };