[iortcw] 393/497: All: Some curl fixes from timangus
Simon McVittie
smcv at debian.org
Fri Sep 8 10:37:34 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to annotated tag 1.42d
in repository iortcw.
commit 7e4c60ce9359c15bdcceeeef05756e1dcd384050
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date: Sun Sep 13 07:35:02 2015 -0400
All: Some curl fixes from timangus
---
MP/code/client/cl_curl.c | 19 +++++++++++++++----
SP/code/client/cl_curl.c | 19 +++++++++++++++----
2 files changed, 30 insertions(+), 8 deletions(-)
diff --git a/MP/code/client/cl_curl.c b/MP/code/client/cl_curl.c
index 3519de0..165bd37 100644
--- a/MP/code/client/cl_curl.c
+++ b/MP/code/client/cl_curl.c
@@ -220,14 +220,25 @@ static size_t CL_cURL_CallbackWrite(void *buffer, size_t size, size_t nmemb,
CURLcode qcurl_easy_setopt_warn(CURL *curl, CURLoption option, ...)
{
CURLcode result;
- va_list args;
- va_start(args, option);
- result = qcurl_easy_setopt(curl, option, args);
- va_end(args);
+ va_list argp;
+ va_start(argp, option);
+
+ 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;
}
diff --git a/SP/code/client/cl_curl.c b/SP/code/client/cl_curl.c
index 3519de0..165bd37 100644
--- a/SP/code/client/cl_curl.c
+++ b/SP/code/client/cl_curl.c
@@ -220,14 +220,25 @@ static size_t CL_cURL_CallbackWrite(void *buffer, size_t size, size_t nmemb,
CURLcode qcurl_easy_setopt_warn(CURL *curl, CURLoption option, ...)
{
CURLcode result;
- va_list args;
- va_start(args, option);
- result = qcurl_easy_setopt(curl, option, args);
- va_end(args);
+ va_list argp;
+ va_start(argp, option);
+
+ 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;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git
More information about the Pkg-games-commits
mailing list