From de454cb861efef76fa94a00c2f7b738935a4a96b Mon Sep 17 00:00:00 2001 From: Moritz <52993648+moha-gh@users.noreply.github.com> Date: Sat, 21 Sep 2024 10:23:46 +0200 Subject: [PATCH] fix(http-storage): Make sure 'keep-alive' can be overridden as expected (#1510) The changes introduced in dfcdb68 made it impossible to disable HTTP keep-alive by setting the 'keep-alive' attribute in the backend string accordingly: The default of 'true' is applied after parsing of the attributes, overriding the value configured by the user (if any). Rectify this. --- src/ccache/storage/remote/httpstorage.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ccache/storage/remote/httpstorage.cpp b/src/ccache/storage/remote/httpstorage.cpp index 9438c45e..d51e9404 100644 --- a/src/ccache/storage/remote/httpstorage.cpp +++ b/src/ccache/storage/remote/httpstorage.cpp @@ -119,6 +119,8 @@ HttpStorageBackend::HttpStorageBackend( m_http_client.set_basic_auth(std::string(user), std::string(*password)); } + m_http_client.set_keep_alive(true); + auto connect_timeout = k_default_connect_timeout; auto operation_timeout = k_default_operation_timeout; @@ -159,7 +161,6 @@ HttpStorageBackend::HttpStorageBackend( m_http_client.set_connection_timeout(connect_timeout); m_http_client.set_read_timeout(operation_timeout); m_http_client.set_write_timeout(operation_timeout); - m_http_client.set_keep_alive(true); m_http_client.set_default_headers(default_headers); } -- 2.47.2