]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
feat: Enable HTTP keep-alive by default (#1000)
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 27 Jan 2022 19:10:05 +0000 (20:10 +0100)
committerGitHub <noreply@github.com>
Thu, 27 Jan 2022 19:10:05 +0000 (20:10 +0100)
doc/MANUAL.adoc
src/storage/secondary/HttpStorage.cpp

index 558f107a76dbd0fa23ff325da237885eed3e41f1..ae386fb1415e9882260776e8580d7a62c88c6aee 100644 (file)
@@ -1105,13 +1105,7 @@ Optional attributes:
 
 * *connect-timeout*: Timeout (in ms) for network connection. The default is 100.
 * *keep-alive*: If *true*, keep the HTTP connection to the storage server open
-  to avoid reconnects. The default is *false*.
-+
-NOTE: Connection keep-alive is disabled by default because with the current
-HTTP implementation uploads to the remote end might fail in case the server
-closes the connection due to a keep-alive timeout. If the general case with
-short compilation times should be accelerated or the server is configured with
-a long-enough timeout, then connection keep-alive could be enabled.
+  to avoid reconnects. The default is *true*.
 * *layout*: How to map key names to the path part of the URL. Available values:
 +
 --
index d768d19830ccf849bfed1b6c2b38d6df7c4cc21f..b7b79e8dfede288945f972d62766cd87b9579d29 100644 (file)
@@ -110,7 +110,7 @@ HttpStorageBackend::HttpStorageBackend(const Params& params)
   m_http_client.set_default_headers({
     {"User-Agent", FMT("{}/{}", CCACHE_NAME, CCACHE_VERSION)},
   });
-  m_http_client.set_keep_alive(false);
+  m_http_client.set_keep_alive(true);
 
   auto connect_timeout = k_default_connect_timeout;
   auto operation_timeout = k_default_operation_timeout;