]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
handle HTTP error 422: Unprocessable Entity by NOT retrying the send to a second...
authorRudolf Polzer <divverent@xonotic.org>
Fri, 28 Oct 2011 19:33:15 +0000 (21:33 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 28 Oct 2011 19:33:15 +0000 (21:33 +0200)
qcsrc/common/urllib.qc

index 2f7d0ee3ab4211609c20257b0f360b0021dee1bb..1bc06502734f66719fd81fabb14b17bb7bd14b3e 100644 (file)
@@ -335,8 +335,16 @@ void url_fputs(entity e, string s)
 void url_multi_ready(entity fh, entity me, float status)
 {
        float n;
-       if(status == URL_READY_ERROR)
+       if(status == URL_READY_ERROR || status < 0)
        {
+               if(status == -422) // Unprocessable Entity
+               {
+                       print("uri_multi_ready: got HTTP error 422, data is in unusable format - not continuing\n");
+                       me.url_ready(fh, me.url_ready_pass, status);
+                       strunzone(me.url_url);
+                       remove(me);
+                       return;
+               }
                me.cnt += 1;
                n = tokenize_console(me.url_url);
                if(n <= me.cnt)