X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Flib%2Furllib.qc;h=2ad7bda2464b6842daa52fb70b2889c1835ab02c;hb=f79d3329e933bd6d5539d2065467772d85c36079;hp=fd8b16d881d7177db5a8f623cb2051f9260ca8ea;hpb=29ba411594428929a9e9a0e0baa620210213bec7;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/lib/urllib.qc b/qcsrc/lib/urllib.qc index fd8b16d88..2ad7bda24 100644 --- a/qcsrc/lib/urllib.qc +++ b/qcsrc/lib/urllib.qc @@ -35,7 +35,7 @@ float url_URI_Get_Callback(int id, float status, string data) if (!e) return 0; if (e.url_rbuf >= 0 || e.url_wbuf >= 0) { - LOG_INFOF("WARNING: handle %d (%s) has already received data?!?\n", id + NUM_URL_ID, e.url_url); + LOG_INFOF("WARNING: handle %d (%s) has already received data?!?", id + NUM_URL_ID, e.url_url); return 0; } @@ -53,18 +53,18 @@ float url_URI_Get_Callback(int id, float status, string data) e.url_rbuf = buf_create(); if (e.url_rbuf < 0) { - LOG_INFO("url_URI_Get_Callback: out of memory in buf_create\n"); + LOG_INFO("url_URI_Get_Callback: out of memory in buf_create"); e.url_ready(e, e.url_ready_pass, URL_READY_ERROR); - strunzone(e.url_url); + strfree(e.url_url); delete(e); return 1; } e.url_rbufpos = 0; if (e.url_rbuf < 0) { - LOG_INFO("url_URI_Get_Callback: out of memory in buf_create\n"); + LOG_INFO("url_URI_Get_Callback: out of memory in buf_create"); e.url_ready(e, e.url_ready_pass, URL_READY_ERROR); - strunzone(e.url_url); + strfree(e.url_url); delete(e); return 1; } @@ -77,7 +77,7 @@ float url_URI_Get_Callback(int id, float status, string data) { // an ERROR e.url_ready(e, e.url_ready_pass, -fabs(status)); - strunzone(e.url_url); + strfree(e.url_url); delete(e); return 1; } @@ -106,9 +106,9 @@ void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass) e.url_wbuf = buf_create(); if (e.url_wbuf < 0) { - LOG_INFO("url_single_fopen: out of memory in buf_create\n"); + LOG_INFO("url_single_fopen: out of memory in buf_create"); rdy(e, pass, URL_READY_ERROR); - strunzone(e.url_url); + strfree(e.url_url); delete(e); return; } @@ -131,7 +131,7 @@ void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass) if (url_fromid[i] == NULL) break; if (i >= autocvar__urllib_nextslot) { - LOG_INFO("url_single_fopen: too many concurrent requests\n"); + LOG_INFO("url_single_fopen: too many concurrent requests"); rdy(NULL, pass, URL_READY_ERROR); return; } @@ -140,7 +140,7 @@ void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass) // GET the data if (!crypto_uri_postbuf(url, i + MIN_URL_ID, string_null, string_null, -1, 0)) { - LOG_INFO("url_single_fopen: failure in crypto_uri_postbuf\n"); + LOG_INFO("url_single_fopen: failure in crypto_uri_postbuf"); rdy(NULL, pass, URL_READY_ERROR); return; } @@ -176,7 +176,7 @@ void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass) rdy(e, pass, URL_READY_CANWRITE); break; case FILE_READ: - LOG_INFO("url_single_fopen: cannot open '-' for reading\n"); + LOG_INFO("url_single_fopen: cannot open '-' for reading"); rdy(NULL, pass, URL_READY_ERROR); break; } @@ -228,10 +228,10 @@ void url_fclose(entity e) if (url_fromid[i] == NULL) break; if (i >= autocvar__urllib_nextslot) { - LOG_INFO("url_fclose: too many concurrent requests\n"); + LOG_INFO("url_fclose: too many concurrent requests"); e.url_ready(e, e.url_ready_pass, URL_READY_ERROR); buf_del(e.url_wbuf); - strunzone(e.url_url); + strfree(e.url_url); delete(e); return; } @@ -240,10 +240,10 @@ void url_fclose(entity e) // POST the data if (!crypto_uri_postbuf(e.url_url, i + MIN_URL_ID, e.url_content_type, e.url_verb, e.url_wbuf, 0)) { - LOG_INFO("url_fclose: failure in crypto_uri_postbuf\n"); + LOG_INFO("url_fclose: failure in crypto_uri_postbuf"); e.url_ready(e, e.url_ready_pass, URL_READY_ERROR); buf_del(e.url_wbuf); - strunzone(e.url_url); + strfree(e.url_url); delete(e); return; } @@ -264,7 +264,7 @@ void url_fclose(entity e) // we have READ all data, just close e.url_ready(e, e.url_ready_pass, URL_READY_CLOSED); buf_del(e.url_rbuf); - strunzone(e.url_url); + strfree(e.url_url); delete(e); } } @@ -339,9 +339,9 @@ void url_multi_ready(entity fh, entity me, float status) { if (status == -422) // Unprocessable Entity { - LOG_INFO("uri_multi_ready: got HTTP error 422, data is in unusable format - not continuing\n"); + LOG_INFO("uri_multi_ready: got HTTP error 422, data is in unusable format - not continuing"); me.url_ready(fh, me.url_ready_pass, status); - strunzone(me.url_url); + strfree(me.url_url); delete(me); return; } @@ -350,7 +350,7 @@ void url_multi_ready(entity fh, entity me, float status) if (n <= me.url_attempt) { me.url_ready(fh, me.url_ready_pass, status); - strunzone(me.url_url); + strfree(me.url_url); delete(me); return; } @@ -367,7 +367,7 @@ void url_multi_fopen(string url, int mode, url_ready_func rdy, entity pass) n = tokenize_console(url); if (n <= 0) { - LOG_INFO("url_multi_fopen: need at least one URL\n"); + LOG_INFO("url_multi_fopen: need at least one URL"); rdy(NULL, pass, URL_READY_ERROR); return; }