Merge pull request #439 from devnexen/curl_little_chg

Little code changes proposal.
This commit is contained in:
Yamagi 2019-09-05 08:30:01 +02:00 committed by GitHub
commit f75b1c24b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,7 +36,7 @@ cvar_t *cl_http_filelists;
cvar_t *cl_http_proxy; cvar_t *cl_http_proxy;
cvar_t *cl_http_max_connections; cvar_t *cl_http_max_connections;
dlquirks_t dlquirks = { .error = false, .filelist = true, .gamedir = '\0' }; dlquirks_t dlquirks = { .error = false, .filelist = true, .gamedir = {'\0'} };
typedef enum typedef enum
{ {
@ -255,15 +255,14 @@ static void CL_StartHTTPDownload (dlqueue_t *entry, dlhandle_t *dl)
Com_sprintf(dl->URL, sizeof(dl->URL), "%s%s", cls.downloadServer, escapedFilePath); Com_sprintf(dl->URL, sizeof(dl->URL), "%s%s", cls.downloadServer, escapedFilePath);
qcurl_easy_setopt(dl->curl, CURLOPT_ENCODING, ""); qcurl_easy_setopt(dl->curl, CURLOPT_ENCODING, "");
qcurl_easy_setopt(dl->curl, CURLOPT_WRITEDATA, dl);
if (dl->file) if (dl->file)
{ {
qcurl_easy_setopt(dl->curl, CURLOPT_WRITEDATA, dl);
qcurl_easy_setopt(dl->curl, CURLOPT_WRITEFUNCTION, CL_HTTP_CurlWriteCB); qcurl_easy_setopt(dl->curl, CURLOPT_WRITEFUNCTION, CL_HTTP_CurlWriteCB);
} }
else else
{ {
qcurl_easy_setopt(dl->curl, CURLOPT_WRITEDATA, dl);
qcurl_easy_setopt(dl->curl, CURLOPT_WRITEFUNCTION, CL_HTTP_Recv); qcurl_easy_setopt(dl->curl, CURLOPT_WRITEFUNCTION, CL_HTTP_Recv);
} }