From d6eb08d0740c30eed00bd600091d60128a6d079a Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 29 Jul 2023 12:58:51 +0800 Subject: Anticipate curl 8 from not being able to download This is cherry-picked from an old commit which was reverted before, but modified so that it only affects the platform that has to use system libcurl 8 (only Windows ARM64 so far). System libcurl, which is typically newer, doesn't accept when SL server responses with an invalid Content-Encoding value (usually some value that's probably meant to be put as the Content-Type value), that we'd get "unrecognized or bad HTTP Content or Transfer-Encoding" https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding A way to fix this would be to just not expect decompressed contents, by letting libcurl have the default value for CURLOPT_ACCEPT_ENCODING, which is NULL. --- indra/llcorehttp/_httpoprequest.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llcorehttp/_httpoprequest.cpp') diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index 6186e7a308..56c0a97635 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -513,7 +513,9 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) check_curl_easy_setopt(mCurlHandle, CURLOPT_NOPROGRESS, 1); check_curl_easy_setopt(mCurlHandle, CURLOPT_URL, mReqURL.c_str()); check_curl_easy_setopt(mCurlHandle, CURLOPT_PRIVATE, getHandle()); +#if LIBCURL_VERSION_MAJOR < 8 check_curl_easy_setopt(mCurlHandle, CURLOPT_ENCODING, ""); +#endif check_curl_easy_setopt(mCurlHandle, CURLOPT_AUTOREFERER, 1); check_curl_easy_setopt(mCurlHandle, CURLOPT_MAXREDIRS, HTTP_REDIRECTS_DEFAULT); @@ -603,7 +605,9 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) case HOR_POST: { check_curl_easy_setopt(mCurlHandle, CURLOPT_POST, 1); +#if LIBCURL_VERSION_MAJOR < 8 check_curl_easy_setopt(mCurlHandle, CURLOPT_ENCODING, ""); +#endif long data_size(0); if (mReqBody) { -- cgit v1.2.3