From d0db131a73933d0a6c65bab59d1e0e4f6a185338 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 6 Jun 2020 13:58:22 +0200 Subject: Code cleanup, use gcc 8 on debian 10 --- http.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'http.cpp') diff --git a/http.cpp b/http.cpp index 1ea960d..b538233 100644 --- a/http.cpp +++ b/http.cpp @@ -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 Server& m_server; std::optional> parser_; request_type req_; - std::shared_ptr res_; + std::shared_ptr res_; // std::shared_ptr ? 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(); -- cgit v1.2.3