summaryrefslogtreecommitdiff
path: root/src/cl_http.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2011-04-04 14:10:51 +0400
committerAndrey Nazarov <skuller@skuller.net>2011-04-07 14:23:30 +0400
commitf071b8eb6c993f608c1361fba3fc9a7262289afc (patch)
tree0318cea66b9ab07835faba1c271509228de388f2 /src/cl_http.c
parent9b8ed7c2035d622dd10153848c3b4ed9d32c50d7 (diff)
Allow downloads to be disabled permanently.
Setting ‘allow_download’ variable to -1 will force the client to disable downloads until it is restarted. This can be used as a protection measure from malicious (or just stupid) servers that force downloads by stuffing commands.
Diffstat (limited to 'src/cl_http.c')
-rw-r--r--src/cl_http.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cl_http.c b/src/cl_http.c
index 6635024..3ee3ac8 100644
--- a/src/cl_http.c
+++ b/src/cl_http.c
@@ -400,6 +400,10 @@ void HTTP_SetServer (const char *url) {
if (!*url)
return;
+ // ignore if downloads are permanently disabled
+ if (allow_download->integer == -1)
+ return;
+
if (strncmp (url, "http://", 7)) {
Com_Printf ("[HTTP] Ignoring download server URL with non-HTTP schema.\n");
return;