diff options
Diffstat (limited to 'src/client/cl_curl.c')
-rw-r--r-- | src/client/cl_curl.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/client/cl_curl.c b/src/client/cl_curl.c index 80aefabe..7f23e7df 100644 --- a/src/client/cl_curl.c +++ b/src/client/cl_curl.c @@ -218,25 +218,27 @@ static size_t CL_cURL_CallbackWrite(void *buffer, size_t size, size_t nmemb, return size*nmemb; } -static CURLcode qcurl_easy_setopt_warn_valist(CURL *curl, CURLoption option, va_list args) -{ - CURLcode result; - - result = qcurl_easy_setopt(curl, option, args); - if(result != CURLE_OK) { - Com_DPrintf("qcurl_easy_setopt failed: %s\n", qcurl_easy_strerror(result)); - } - - return result; -} - CURLcode qcurl_easy_setopt_warn(CURL *curl, CURLoption option, ...) { CURLcode result; va_list argp; va_start(argp, option); - result = qcurl_easy_setopt_warn_valist(curl, option, argp); + + if(option < CURLOPTTYPE_OBJECTPOINT) { + long longValue = va_arg(argp, long); + result = qcurl_easy_setopt_warn(curl, option, longValue); + } else if(option < CURLOPTTYPE_OFF_T) { + void *pointerValue = va_arg(argp, void *); + result = qcurl_easy_setopt_warn(curl, option, pointerValue); + } else { + curl_off_t offsetValue = va_arg(argp, curl_off_t); + result = qcurl_easy_setopt_warn(curl, option, offsetValue); + } + + if(result != CURLE_OK) { + Com_DPrintf("qcurl_easy_setopt failed: %s\n", qcurl_easy_strerror(result)); + } va_end(argp); return result; |