]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix a crash on CentOS 5.6
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 14 Sep 2011 12:39:39 +0000 (12:39 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 14 Sep 2011 12:39:39 +0000 (12:39 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11350 d7cf8633-e32d-0410-b094-e92efae38249

libcurl.c

index b472d9e9c4033d69ff98a44ea1b3e06da9eb947a..1cdd18b5bee2be46ea71a73f39235ddb7eafc090 100644 (file)
--- 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(;;)