diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-06-06 13:58:22 +0200 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-06-06 13:58:22 +0200 |
commit | d0db131a73933d0a6c65bab59d1e0e4f6a185338 (patch) | |
tree | 06edad4d845c8ba4102843fc3b306d7b5cc485d6 /http.cpp | |
parent | 343922258d57261021daca42eb488c1205ae491c (diff) |
Code cleanup, use gcc 8 on debian 10
Diffstat (limited to 'http.cpp')
-rw-r--r-- | http.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -40,8 +40,7 @@ namespace { //------------------------------------------------------------------------------ // Report a failure -void -fail(beast::error_code ec, char const* what) +void fail(beast::error_code ec, char const* what) { std::cerr << what << ": " << ec.message() << "\n"; } @@ -59,7 +58,7 @@ class session : public std::enable_shared_from_this<session> Server& m_server; std::optional<http::request_parser<http::string_body>> parser_; request_type req_; - std::shared_ptr<response_type> res_; + std::shared_ptr<response_type> res_; // std::shared_ptr<void> ? void handle_request(::Server& server, request_type&& req) { @@ -116,8 +115,7 @@ public: } // Start the asynchronous operation - void - run() + void run() { // We need to be executing within a strand to perform async operations // on the I/O objects in this session. @@ -131,8 +129,7 @@ public: #endif } - void - do_read() + void do_read() { // Make the request empty before reading, // otherwise the operation behavior is undefined. @@ -179,10 +176,13 @@ public: boost::ignore_unused(bytes_transferred); // This means they closed the connection - if(ec == http::error::end_of_stream) + if (ec == http::error::end_of_stream) return do_close(); - if(ec) + if (ec == http::error::partial_message) + return; // ignore + + if (ec) return fail(ec, "read"); req_ = parser_->get(); |