From: divverent Date: Wed, 14 Sep 2011 12:39:39 +0000 (+0000) Subject: fix a crash on CentOS 5.6 X-Git-Tag: xonotic-v0.6.0~163^2~202 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a99ab3f4f90e80aaefec428691ec9cc5d904ec93;p=xonotic%2Fdarkplaces.git fix a crash on CentOS 5.6 git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11350 d7cf8633-e32d-0410-b094-e92efae38249 --- 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(;;)