summaryrefslogtreecommitdiffhomepage
path: root/http.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'http.cpp')
-rw-r--r--http.cpp18
1 files changed, 9 insertions, 9 deletions
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<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();