From: Marcin Siodelski Date: Thu, 22 Mar 2018 11:27:21 +0000 (+0100) Subject: [5470] Fixes in HTTP client in case of broken connection. X-Git-Tag: trac5458a_base~32^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c37f28e1e47addd202f2d07cf462482079603274;p=thirdparty%2Fkea.git [5470] Fixes in HTTP client in case of broken connection. --- diff --git a/src/lib/http/client.cc b/src/lib/http/client.cc index 7da68df029..7ec5dd53d1 100644 --- a/src/lib/http/client.cc +++ b/src/lib/http/client.cc @@ -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