From: Rudolf Polzer Date: Wed, 17 Aug 2011 18:31:16 +0000 (+0200) Subject: error handling a bit better X-Git-Tag: xonotic-v0.5.0~130 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=01efe43f08cb839bdfe8cfee61ca9821695aba45;p=xonotic%2Fxonotic-data.pk3dir.git error handling a bit better --- diff --git a/qcsrc/common/urllib.qc b/qcsrc/common/urllib.qc index 83e00f119..934d15130 100644 --- a/qcsrc/common/urllib.qc +++ b/qcsrc/common/urllib.qc @@ -84,9 +84,9 @@ void url_fopen(string url, float mode, entity pass, url_ready_func rdy) if(e.url_wbuf < 0) { print("buf_create: out of memory\n"); + rdy(e, pass, URL_READY_ERROR); strunzone(e.url_url); remove(e); - rdy(world, pass, URL_READY_ERROR); return; } e.url_wbufpos = 0; @@ -113,10 +113,9 @@ void url_fopen(string url, float mode, entity pass, url_ready_func rdy) e.url_wbuf = -1; if(!uri_get(url, i + MIN_URL_ID)) { - print("uri_get: failed\n"); + rdy(e, pass, URL_READY_ERROR); strunzone(e.url_url); remove(e); - rdy(world, pass, URL_READY_ERROR); return; } e.url_ready = rdy; @@ -161,8 +160,8 @@ void url_fclose(entity e, entity pass, url_ready_func rdy) break; if(i >= NUM_URL_ID) { - rdy(e, pass, URL_READY_ERROR); buf_del(e.url_wbuf); + rdy(e, pass, URL_READY_ERROR); strunzone(e.url_url); remove(e); return; @@ -170,8 +169,8 @@ void url_fclose(entity e, entity pass, url_ready_func rdy) if(!uri_postbuf(e.url_url, e.url_id + MIN_URL_ID, "text/plain", "\n", e.url_wbuf)) { - rdy(e, pass, URL_READY_ERROR); buf_del(e.url_wbuf); + rdy(e, pass, URL_READY_ERROR); strunzone(e.url_url); remove(e); return;