Replace "Fix keepalive false" with patchset 3
This reverts commit 5ae6f9254161f7229216c08b591e31eaf10f69e4.
And replaces it with patchset 3 from the same review, for which was
tested to work properly. This commit was merged erroneously.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I201924ad27d33923d43bdf82ecb016a0f214b4dd
diff --git a/http/http_connection.hpp b/http/http_connection.hpp
index aa8b8c9..c98c454 100644
--- a/http/http_connection.hpp
+++ b/http/http_connection.hpp
@@ -189,7 +189,6 @@
return;
}
thisReq.session = userSession;
- res.keepAlive(thisReq.keepAlive());
// Fetch the client IP address
readClientIp();
@@ -221,6 +220,7 @@
completeRequest(res);
return;
}
+ keepAlive = thisReq.keepAlive();
#ifndef BMCWEB_INSECURE_DISABLE_AUTHX
if (!crow::authentication::isOnAllowlist(req->url, req->method()) &&
thisReq.session == nullptr)
@@ -302,9 +302,10 @@
return;
}
res = std::move(thisRes);
+ res.keepAlive(keepAlive);
BMCWEB_LOG_INFO << "Response: " << this << ' ' << req->url << ' '
- << res.resultInt() << " keepalive=" << res.keepAlive();
+ << res.resultInt() << " keepalive=" << keepAlive;
addSecurityHeaders(*req, res);
@@ -534,7 +535,7 @@
BMCWEB_LOG_DEBUG << this << " from write(2)";
return;
}
- if (!serializer->get().keep_alive())
+ if (!keepAlive)
{
close();
BMCWEB_LOG_DEBUG << this << " from write(1)";
@@ -633,6 +634,8 @@
boost::asio::steady_timer timer;
+ bool keepAlive = true;
+
std::function<std::string()>& getCachedDateStr;
using std::enable_shared_from_this<