From c37f28e1e47addd202f2d07cf462482079603274 Mon Sep 17 00:00:00 2001 From: Marcin Siodelski Date: Thu, 22 Mar 2018 12:27:21 +0100 Subject: [PATCH] [5470] Fixes in HTTP client in case of broken connection. --- src/lib/http/client.cc | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.47.2