curl: force http1.1 to workaround around some temporary issues with http2 requests (most noticable with dropbox)

See https://github.com/curl/curl/issues/9526 for more details
This commit is contained in:
UnknownShadow200 2022-09-26 20:38:31 +10:00
parent f8e4835abf
commit e6a49460eb
2 changed files with 5 additions and 1 deletions

View File

@ -221,6 +221,9 @@ typedef int CURLcode;
#define CURLOPT_HEADERFUNCTION (20000 + 79)
#define CURLOPT_HTTPGET (0 + 80)
#define CURLOPT_SSL_VERIFYHOST (0 + 81)
#define CURLOPT_HTTP_VERSION (0 + 84)
#define CURL_HTTP_VERSION_1_1 2L /* stick to HTTP 1.1 */
#if defined _WIN32
#define APIENTRY __cdecl
@ -345,6 +348,7 @@ static void Http_SetCurlOpts(struct HttpRequest* req) {
_curl_easy_setopt(curl, CURLOPT_USERAGENT, GAME_APP_NAME);
_curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
_curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 20L);
_curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
_curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, Http_ProcessHeader);
_curl_easy_setopt(curl, CURLOPT_HEADERDATA, req);

View File

@ -449,7 +449,7 @@ static struct ZipfileSource {
const char* url;
cc_result (*Process)(struct HttpRequest* req);
short size;
cc_bool downloaded;
cc_bool downloaded, last;
int reqID;
} defaultZipSources[] = {
{ "classic jar", "http://launcher.mojang.com/mc/game/c0.30_01c/client/54622801f5ef1bcc1549a842c5b04cb5d5583005/client.jar", ClassicPatcher_ExtractFiles, 291 },