]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - libcurl.c
patch from div0 to make svc_finale text show up immediately if scr_printspeed is...
[xonotic/darkplaces.git] / libcurl.c
index 7c30291df2fcb6f065c5a813a84f87b8b51db43f..3ee6111b3623ca8b0619c2c0699eaa1485ba9a41 100644 (file)
--- a/libcurl.c
+++ b/libcurl.c
@@ -3,7 +3,7 @@
 #include "libcurl.h"
 
 static cvar_t cl_curl_maxdownloads = {CVAR_SAVE, "cl_curl_maxdownloads","1", "maximum number of concurrent HTTP/FTP downloads"};
-static cvar_t cl_curl_maxspeed = CVAR_SAVE, "cl_curl_maxspeed","100", "maximum download speed (KiB/s)"};
+static cvar_t cl_curl_maxspeed = {CVAR_SAVE, "cl_curl_maxspeed","100", "maximum download speed (KiB/s)"};
 static cvar_t sv_curl_defaulturl = {CVAR_SAVE, "sv_curl_defaulturl","", "default autodownload source URL"};
 static cvar_t sv_curl_serverpackages = {CVAR_SAVE, "sv_curl_serverpackages","", "list of required files for the clients, separated by spaces"};
 static cvar_t cl_curl_enabled = {CVAR_SAVE, "cl_curl_enabled","0", "whether client's download support is enabled"};
@@ -642,7 +642,7 @@ void Curl_Begin(const char *URL, const char *name, qboolean ispak, qboolean fort
                                return;
                        }
                }
-               
+
                if(ispak && FS_FileExists(fn))
                {
                        qboolean already_loaded;
@@ -737,7 +737,7 @@ void Curl_Run()
        {
                int remaining;
                CURLMcode mc;
-               
+
                do
                {
                        mc = qcurl_multi_perform(curlm, &remaining);
@@ -773,7 +773,7 @@ void Curl_Run()
                                                        break;
                                        }
                                }
-                               
+
                                Curl_EndDownload(di, failed, result);
                        }
                }
@@ -1030,7 +1030,7 @@ void Curl_Curl_f(void)
                                char donecommand[256];
                                if(cls.netcon)
                                {
-                                       if(cls.signon >= 3)
+                                       if(cl.loadbegun) // curling won't inhibit loading the map any more when at this stage, so bail out and force a reconnect
                                        {
                                                dpsnprintf(donecommand, sizeof(donecommand), "connect %s", cls.netcon->address);
                                                Curl_CommandWhenDone(donecommand);
@@ -1120,7 +1120,7 @@ Curl_downloadinfo_t *Curl_GetDownloadInfo(int *nDownloads, const char **addition
                }
                ++i;
        }
-       
+
        if(additional_info)
        {
                // TODO: can I clear command_when_done as soon as the first download fails?
@@ -1178,7 +1178,7 @@ static const char *Curl_FindPackURL(const char *filename)
                char *p = buf;
                char *pattern = NULL, *patternend = NULL, *url = NULL, *urlend = NULL;
                qboolean eof = false;
-               
+
                pattern = p;
                while(!eof)
                {