summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--http/http_client.hpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/http/http_client.hpp b/http/http_client.hpp
index f59438be8c..c9526bbaf4 100644
--- a/http/http_client.hpp
+++ b/http/http_client.hpp
@@ -63,7 +63,6 @@ enum class ConnState
recvInProgress,
recvFailed,
idle,
- closeInProgress,
closed,
suspended,
terminated,
@@ -355,7 +354,6 @@ class ConnectionInfo : public std::enable_shared_from_this<ConnectionInfo>
void doClose()
{
- state = ConnState::closeInProgress;
boost::beast::error_code ec;
conn.socket().shutdown(boost::asio::ip::tcp::socket::shutdown_both, ec);
conn.close();
@@ -366,18 +364,19 @@ class ConnectionInfo : public std::enable_shared_from_this<ConnectionInfo>
BMCWEB_LOG_ERROR << host << ":" << std::to_string(port)
<< ", id: " << std::to_string(connId)
<< "shutdown failed: " << ec.message();
- return;
}
- BMCWEB_LOG_DEBUG << host << ":" << std::to_string(port)
- << ", id: " << std::to_string(connId)
- << " closed gracefully";
+ else
+ {
+ BMCWEB_LOG_DEBUG << host << ":" << std::to_string(port)
+ << ", id: " << std::to_string(connId)
+ << " closed gracefully";
+ }
state = ConnState::closed;
}
void doCloseAndRetry()
{
- state = ConnState::closeInProgress;
boost::beast::error_code ec;
conn.socket().shutdown(boost::asio::ip::tcp::socket::shutdown_both, ec);
conn.close();
@@ -388,11 +387,13 @@ class ConnectionInfo : public std::enable_shared_from_this<ConnectionInfo>
BMCWEB_LOG_ERROR << host << ":" << std::to_string(port)
<< ", id: " << std::to_string(connId)
<< "shutdown failed: " << ec.message();
- return;
}
- BMCWEB_LOG_DEBUG << host << ":" << std::to_string(port)
- << ", id: " << std::to_string(connId)
- << " closed gracefully";
+ else
+ {
+ BMCWEB_LOG_DEBUG << host << ":" << std::to_string(port)
+ << ", id: " << std::to_string(connId)
+ << " closed gracefully";
+ }
// Now let's try to resend the data
state = ConnState::retry;