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 f5b5c6b262196fa95dacb307a230d62fd45cbcfa
Author: MAN-AT-ARMS <m4n4t4...@gmail.com>
Date:   Thu Jul 30 18:18:58 2015 -0400

    All: Merge Pan7's curl warnings
---
 MP/code/client/cl_curl.c | 55 +++++++++++++++++++++++++++++++++++-------------
 SP/code/client/cl_curl.c | 55 +++++++++++++++++++++++++++++++++++-------------
 2 files changed, 80 insertions(+), 30 deletions(-)

diff --git a/MP/code/client/cl_curl.c b/MP/code/client/cl_curl.c
index 9f186ae..3519de0 100644
--- a/MP/code/client/cl_curl.c
+++ b/MP/code/client/cl_curl.c
@@ -177,12 +177,20 @@ void CL_cURL_Shutdown( void )
 void CL_cURL_Cleanup(void)
 {
        if(clc.downloadCURLM) {
+               CURLMcode result;
+
                if(clc.downloadCURL) {
-                       qcurl_multi_remove_handle(clc.downloadCURLM,
+                       result = qcurl_multi_remove_handle(clc.downloadCURLM,
                                clc.downloadCURL);
+                       if(result != CURLM_OK) {
+                               Com_DPrintf("qcurl_multi_remove_handle failed: 
%s\n", qcurl_multi_strerror(result));
+                       }
                        qcurl_easy_cleanup(clc.downloadCURL);
                }
-               qcurl_multi_cleanup(clc.downloadCURLM);
+               result = qcurl_multi_cleanup(clc.downloadCURLM);
+               if(result != CURLM_OK) {
+                       Com_DPrintf("CL_cURL_Cleanup: qcurl_multi_cleanup 
failed: %s\n", qcurl_multi_strerror(result));
+               }
                clc.downloadCURLM = NULL;
                clc.downloadCURL = NULL;
        }
@@ -209,6 +217,21 @@ static size_t CL_cURL_CallbackWrite(void *buffer, size_t 
size, size_t nmemb,
        return size*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);
+       if(result != CURLE_OK) {
+               Com_DPrintf("qcurl_easy_setopt failed: %s\n", 
qcurl_easy_strerror(result));
+       }
+
+       return result;
+}
+
 void CL_cURL_BeginDownload( const char *localName, const char *remoteURL )
 {
        CURLMcode result;
@@ -248,23 +271,23 @@ void CL_cURL_BeginDownload( const char *localName, const 
char *remoteURL )
        }
 
        if(com_developer->integer)
-               qcurl_easy_setopt(clc.downloadCURL, CURLOPT_VERBOSE, 1);
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_URL, clc.downloadURL);
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_TRANSFERTEXT, 0);
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_REFERER, va("ioQ3://%s",
+               qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_VERBOSE, 1);
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_URL, clc.downloadURL);
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_TRANSFERTEXT, 0);
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_REFERER, 
va("ioQ3://%s",
                NET_AdrToString(clc.serverAddress)));
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_USERAGENT, va("%s %s",
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_USERAGENT, va("%s %s",
                Q3_VERSION, qcurl_version()));
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_WRITEFUNCTION,
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_WRITEFUNCTION,
                CL_cURL_CallbackWrite);
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_WRITEDATA, &clc.download);
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_NOPROGRESS, 0);
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_PROGRESSFUNCTION,
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_WRITEDATA, 
&clc.download);
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_NOPROGRESS, 0);
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_PROGRESSFUNCTION,
                CL_cURL_CallbackProgress);
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_PROGRESSDATA, NULL);
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_FAILONERROR, 1);
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_FOLLOWLOCATION, 1);
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_MAXREDIRS, 5);
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_PROGRESSDATA, NULL);
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_FAILONERROR, 1);
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_FOLLOWLOCATION, 1);
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_MAXREDIRS, 5);
        clc.downloadCURLM = qcurl_multi_init(); 
        if(!clc.downloadCURLM) {
                qcurl_easy_cleanup(clc.downloadCURL);
@@ -275,6 +298,8 @@ void CL_cURL_BeginDownload( const char *localName, const 
char *remoteURL )
        }
        result = qcurl_multi_add_handle(clc.downloadCURLM, clc.downloadCURL);
        if(result != CURLM_OK) {
+               qcurl_easy_cleanup(clc.downloadCURL);
+               clc.downloadCURL = NULL;
                Com_Error(ERR_DROP,"CL_cURL_BeginDownload: 
qcurl_multi_add_handle() failed: %s", qcurl_multi_strerror(result));
                return;
        }
diff --git a/SP/code/client/cl_curl.c b/SP/code/client/cl_curl.c
index 9f186ae..3519de0 100644
--- a/SP/code/client/cl_curl.c
+++ b/SP/code/client/cl_curl.c
@@ -177,12 +177,20 @@ void CL_cURL_Shutdown( void )
 void CL_cURL_Cleanup(void)
 {
        if(clc.downloadCURLM) {
+               CURLMcode result;
+
                if(clc.downloadCURL) {
-                       qcurl_multi_remove_handle(clc.downloadCURLM,
+                       result = qcurl_multi_remove_handle(clc.downloadCURLM,
                                clc.downloadCURL);
+                       if(result != CURLM_OK) {
+                               Com_DPrintf("qcurl_multi_remove_handle failed: 
%s\n", qcurl_multi_strerror(result));
+                       }
                        qcurl_easy_cleanup(clc.downloadCURL);
                }
-               qcurl_multi_cleanup(clc.downloadCURLM);
+               result = qcurl_multi_cleanup(clc.downloadCURLM);
+               if(result != CURLM_OK) {
+                       Com_DPrintf("CL_cURL_Cleanup: qcurl_multi_cleanup 
failed: %s\n", qcurl_multi_strerror(result));
+               }
                clc.downloadCURLM = NULL;
                clc.downloadCURL = NULL;
        }
@@ -209,6 +217,21 @@ static size_t CL_cURL_CallbackWrite(void *buffer, size_t 
size, size_t nmemb,
        return size*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);
+       if(result != CURLE_OK) {
+               Com_DPrintf("qcurl_easy_setopt failed: %s\n", 
qcurl_easy_strerror(result));
+       }
+
+       return result;
+}
+
 void CL_cURL_BeginDownload( const char *localName, const char *remoteURL )
 {
        CURLMcode result;
@@ -248,23 +271,23 @@ void CL_cURL_BeginDownload( const char *localName, const 
char *remoteURL )
        }
 
        if(com_developer->integer)
-               qcurl_easy_setopt(clc.downloadCURL, CURLOPT_VERBOSE, 1);
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_URL, clc.downloadURL);
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_TRANSFERTEXT, 0);
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_REFERER, va("ioQ3://%s",
+               qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_VERBOSE, 1);
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_URL, clc.downloadURL);
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_TRANSFERTEXT, 0);
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_REFERER, 
va("ioQ3://%s",
                NET_AdrToString(clc.serverAddress)));
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_USERAGENT, va("%s %s",
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_USERAGENT, va("%s %s",
                Q3_VERSION, qcurl_version()));
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_WRITEFUNCTION,
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_WRITEFUNCTION,
                CL_cURL_CallbackWrite);
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_WRITEDATA, &clc.download);
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_NOPROGRESS, 0);
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_PROGRESSFUNCTION,
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_WRITEDATA, 
&clc.download);
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_NOPROGRESS, 0);
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_PROGRESSFUNCTION,
                CL_cURL_CallbackProgress);
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_PROGRESSDATA, NULL);
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_FAILONERROR, 1);
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_FOLLOWLOCATION, 1);
-       qcurl_easy_setopt(clc.downloadCURL, CURLOPT_MAXREDIRS, 5);
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_PROGRESSDATA, NULL);
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_FAILONERROR, 1);
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_FOLLOWLOCATION, 1);
+       qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_MAXREDIRS, 5);
        clc.downloadCURLM = qcurl_multi_init(); 
        if(!clc.downloadCURLM) {
                qcurl_easy_cleanup(clc.downloadCURL);
@@ -275,6 +298,8 @@ void CL_cURL_BeginDownload( const char *localName, const 
char *remoteURL )
        }
        result = qcurl_multi_add_handle(clc.downloadCURLM, clc.downloadCURL);
        if(result != CURLM_OK) {
+               qcurl_easy_cleanup(clc.downloadCURL);
+               clc.downloadCURL = NULL;
                Com_Error(ERR_DROP,"CL_cURL_BeginDownload: 
qcurl_multi_add_handle() failed: %s", qcurl_multi_strerror(result));
                return;
        }

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-games/iortcw.git

_______________________________________________
Pkg-games-commits mailing list
Pkg-games-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

Reply via email to