From 5776c0a692ad2848339d3bef9cae18032d6ad23a Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 29 Jul 2023 12:58:51 +0800 Subject: Fix newer libcurl from not being able to download 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 ++-- indra/llcorehttp/httpcommon.cpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index ba31290c24..6c408c6687 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -508,7 +508,7 @@ 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()); - check_curl_easy_setopt(mCurlHandle, CURLOPT_ENCODING, ""); + //check_curl_easy_setopt(mCurlHandle, CURLOPT_ENCODING, ""); check_curl_easy_setopt(mCurlHandle, CURLOPT_AUTOREFERER, 1); check_curl_easy_setopt(mCurlHandle, CURLOPT_MAXREDIRS, HTTP_REDIRECTS_DEFAULT); @@ -598,7 +598,7 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) case HOR_POST: { check_curl_easy_setopt(mCurlHandle, CURLOPT_POST, 1); - check_curl_easy_setopt(mCurlHandle, CURLOPT_ENCODING, ""); + //check_curl_easy_setopt(mCurlHandle, CURLOPT_ENCODING, ""); long data_size(0); if (mReqBody) { diff --git a/indra/llcorehttp/httpcommon.cpp b/indra/llcorehttp/httpcommon.cpp index 61ba83594e..856602e50b 100644 --- a/indra/llcorehttp/httpcommon.cpp +++ b/indra/llcorehttp/httpcommon.cpp @@ -289,8 +289,10 @@ CURL *getCurlTemplateHandle() check_curl_code(result, CURLOPT_NOSIGNAL); result = curl_easy_setopt(curlpTemplateHandle, CURLOPT_NOPROGRESS, 1); check_curl_code(result, CURLOPT_NOPROGRESS); + /* result = curl_easy_setopt(curlpTemplateHandle, CURLOPT_ENCODING, ""); check_curl_code(result, CURLOPT_ENCODING); + */ result = curl_easy_setopt(curlpTemplateHandle, CURLOPT_AUTOREFERER, 1); check_curl_code(result, CURLOPT_AUTOREFERER); result = curl_easy_setopt(curlpTemplateHandle, CURLOPT_FOLLOWLOCATION, 1); -- cgit v1.2.3