// whatever happens, we will remove the URL from the list of IDs
url_fromid[id] = world;
+ // if we get here, we MUST have both buffers cleared
+ if(e.url_rbuf != -1 || e.url_wbuf != -1 || e.url_fh != -1)
+ error("url_URI_Get_Callback: not a request waiting for data");
+
if(status == 0)
{
// WE GOT DATA!
if(e.url_fh < 0)
{
+ if(e.url_rbuf == -1 || e.url_wbuf != -1) // not(post GET/POST request)
+ if(e.url_rbuf != -1 || e.url_wbuf == -1) // not(pre POST request)
+ error("url_fclose: not closable in current state");
+
// closing an URL!
if(e.url_wbuf >= 0)
{
{
if(e.url_fh < 0)
{
+ if(e.url_rbuf == -1)
+ error("url_fgets: not readable in current state");
// curl
string s;
s = bufstr_get(e.url_rbuf, e.url_rbufpos);
{
if(e.url_fh < 0)
{
+ if(e.url_wbuf == -1)
+ error("url_fputs: not writable in current state");
// curl
bufstr_set(e.url_wbuf, e.url_wbufpos, s);
e.url_wbufpos += 1;