From 4928e910e7e5bfcb086eed2922f45da492112db4 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Fri, 28 Oct 2011 21:33:15 +0200 Subject: [PATCH] handle HTTP error 422: Unprocessable Entity by NOT retrying the send to a second receiving URL --- qcsrc/common/urllib.qc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/qcsrc/common/urllib.qc b/qcsrc/common/urllib.qc index 2f7d0ee3a..1bc065027 100644 --- a/qcsrc/common/urllib.qc +++ b/qcsrc/common/urllib.qc @@ -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) -- 2.39.2