From a99ab3f4f90e80aaefec428691ec9cc5d904ec93 Mon Sep 17 00:00:00 2001 From: divverent Date: Wed, 14 Sep 2011 12:39:39 +0000 Subject: [PATCH] fix a crash on CentOS 5.6 git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11350 d7cf8633-e32d-0410-b094-e92efae38249 --- libcurl.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libcurl.c b/libcurl.c index b472d9e9..1cdd18b5 100644 --- a/libcurl.c +++ b/libcurl.c @@ -677,7 +677,6 @@ static void CheckPendingDownloads(void) } qcurl_easy_setopt(di->curle, CURLOPT_HTTPHEADER, di->slist); - qcurl_multi_add_handle(curlm, di->curle); di->started = true; @@ -1022,12 +1021,15 @@ void Curl_Run(void) for(di = downloads; di; di = di->next) { double b = 0; - qcurl_easy_getinfo(di->curle, CURLINFO_SIZE_UPLOAD, &b); - bytes_sent += (b - di->bytes_sent_curl); - di->bytes_sent_curl = b; - qcurl_easy_getinfo(di->curle, CURLINFO_SIZE_DOWNLOAD, &b); - bytes_sent += (b - di->bytes_received_curl); - di->bytes_received_curl = b; + if(di->curle) + { + qcurl_easy_getinfo(di->curle, CURLINFO_SIZE_UPLOAD, &b); + bytes_sent += (b - di->bytes_sent_curl); + di->bytes_sent_curl = b; + qcurl_easy_getinfo(di->curle, CURLINFO_SIZE_DOWNLOAD, &b); + bytes_sent += (b - di->bytes_received_curl); + di->bytes_received_curl = b; + } } for(;;) -- 2.39.2