From 2ecde74fa187366dc4ed628e61a88015cdbeb769 Mon Sep 17 00:00:00 2001 From: Abhilash Raju Date: Sat, 1 Jun 2024 02:01:01 -0500 Subject: http_client: Fixing bug in retry after a close call After a close call httpclient is not starting with fresh socket to restart the connection. Send failure is observed in cases where new connection is started from doResolve.Calling restartConnection instead of doResolve did fix the issue. Tested By: Running developer test on use cases such as redfish aggregation where number of retries are smaller. Change-Id: I12f6a73fbafd14f482807f34ffa1e02fad944fc1 Signed-off-by: Abhilash Raju --- http/http_client.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'http') diff --git a/http/http_client.hpp b/http/http_client.hpp index 0bfb3818df..107f943923 100644 --- a/http/http_client.hpp +++ b/http/http_client.hpp @@ -706,7 +706,7 @@ class ConnectionPool : public std::enable_shared_from_this // Server is not keep-alive enabled so we need to close the // connection and then start over from resolve conn->doClose(); - conn->doResolve(); + conn->restartConnection(); } return; } @@ -760,7 +760,7 @@ class ConnectionPool : public std::enable_shared_from_this { BMCWEB_LOG_DEBUG("Reusing existing connection {}", commonMsg); - conn->doResolve(); + conn->restartConnection(); } return; } -- cgit v1.2.3