Browse Source

[5189] HTTP acceptor checks for operation aborted status.

Marcin Siodelski 8 years ago
parent
commit
dcecbde0dd
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/lib/http/connection.cc

+ 6 - 0
src/lib/http/connection.cc

@@ -118,6 +118,12 @@ HttpConnection::asyncSendResponse(const ConstHttpResponsePtr& response) {
 
 void
 HttpConnection::acceptorCallback(const boost::system::error_code& ec) {
+    // Operation is aborted when the acceptor is cancelled, as a result
+    // of stopping the connection. This is not an error condition.
+    if (ec.value() == boost::asio::error::operation_aborted) {
+        return;
+    }
+
     if (!acceptor_.isOpen()) {
         return;
     }