From d6097cb64cff07ff6083e1a09efc0a27f3e508f6 Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Sun, 7 Mar 2021 22:41:34 +0100 Subject: [PATCH] Automatically use HTTPS compression if the server supports it Our typical HTTPS answer is reduced by 85% by this. Our JSON seems to compress really well. --- src/engine/client/http.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/engine/client/http.cpp b/src/engine/client/http.cpp index 2504a368f..e9631da31 100644 --- a/src/engine/client/http.cpp +++ b/src/engine/client/http.cpp @@ -140,6 +140,7 @@ int CRequest::RunImpl(CURL *pHandle) curl_easy_setopt(pHandle, CURLOPT_URL, m_aUrl); curl_easy_setopt(pHandle, CURLOPT_NOSIGNAL, 1L); curl_easy_setopt(pHandle, CURLOPT_USERAGENT, GAME_NAME " " GAME_RELEASE_VERSION " (" CONF_PLATFORM_STRING "; " CONF_ARCH_STRING ")"); + curl_easy_setopt(pHandle, CURLOPT_ACCEPT_ENCODING, ""); // Use any compression algorithm supported by libcurl. curl_easy_setopt(pHandle, CURLOPT_WRITEDATA, this); curl_easy_setopt(pHandle, CURLOPT_WRITEFUNCTION, WriteCallback);