diff options
author | Ed Tanous <edtanous@google.com> | 2023-01-13 21:03:22 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2023-01-21 00:06:50 +0300 |
commit | 4cdc2e8d4cc2358e5e35e978502c944f44fe5c67 (patch) | |
tree | d8c4bb7245571ea1a9f64dc728a960808f63d6c2 | |
parent | 7b395d7c9538360f8b034481fedcdeb5d3ee784b (diff) | |
download | bmcweb-4cdc2e8d4cc2358e5e35e978502c944f44fe5c67.tar.xz |
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
-rw-r--r-- | http/http_connection.hpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/http/http_connection.hpp b/http/http_connection.hpp index aa8b8c9510..c98c454f5d 100644 --- a/http/http_connection.hpp +++ b/http/http_connection.hpp @@ -189,7 +189,6 @@ class Connection : return; } thisReq.session = userSession; - res.keepAlive(thisReq.keepAlive()); // Fetch the client IP address readClientIp(); @@ -221,6 +220,7 @@ class Connection : 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 @@ class Connection : 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 @@ class Connection : 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 @@ class Connection : boost::asio::steady_timer timer; + bool keepAlive = true; + std::function<std::string()>& getCachedDateStr; using std::enable_shared_from_this< |