]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5470] Fixes in HTTP client in case of broken connection.
authorMarcin Siodelski <marcin@isc.org>
Thu, 22 Mar 2018 11:27:21 +0000 (12:27 +0100)
committerMarcin Siodelski <marcin@isc.org>
Thu, 22 Mar 2018 11:27:21 +0000 (12:27 +0100)
src/lib/http/client.cc

index 7da68df0293a583e2ccd742120f201ab4e91db41..7ec5dd53d10c3ac6843bf0a18bf025eab2f03f0a 100644 (file)
@@ -473,6 +473,7 @@ Connection::isTransactionOngoing() const {
 void
 Connection::terminate(const boost::system::error_code& ec,
                       const std::string& parsing_error) {
+
     timer_.cancel();
     socket_.cancel();
 
@@ -558,6 +559,7 @@ Connection::sendCallback(const boost::system::error_code& ec, size_t length) {
         } else {
             // Any other error should cause the transaction to terminate.
             terminate(ec);
+            return;
         }
     }
 
@@ -585,6 +587,7 @@ Connection::receiveCallback(const boost::system::error_code& ec, size_t length)
         if ((ec.value() != boost::asio::error::try_again) &&
             (ec.value() != boost::asio::error::would_block)) {
             terminate(ec);
+            return;
 
         } else {
             // For EAGAIN and EWOULDBLOCK the length should be 0 anyway, but let's