http->wused = 0;
- DEBUG_printf(("1httpFlushWrite: Returning %d.", bytes));
+ DEBUG_printf(("1httpFlushWrite: Returning %d, errno=%d.", bytes, errno));
return (bytes);
}
* No newline; see if there is more data to be read...
*/
- if (!http->blocking && !_httpWait(http, 10000, 1))
+ if (!_httpWait(http, http->blocking ? 30000 : 10000, 1))
{
DEBUG_puts("3httpGets: Timed out!");
#ifdef WIN32
* First see if there is data in the buffer...
*/
+ DEBUG_printf(("2httpWait(http=%p, msec=%d)", http, msec));
+
if (http == NULL)
return (0);
if (http->used)
+ {
+ DEBUG_puts("3httpWait: Returning 1 since there is buffered data ready.");
return (1);
+ }
/*
* Flush pending data, if any...
if (http->wused)
{
+ DEBUG_puts("3httpWait: Flushing write buffer.");
+
if (httpFlushWrite(http) < 0)
return (0);
}
{
status = httpUpdate(http);
}
- while (http->state == HTTP_POST_RECV);
+ while (status != HTTP_ERROR && http->state == HTTP_POST_RECV);
DEBUG_printf(("2cupsGetResponse: status=%d", status));
break;
}
+ if (state == IPP_ERROR)
+ {
+ http->status = HTTP_ERROR;
+ http->state = HTTP_WAITING;
+
+ return (HTTP_ERROR);
+ }
+
/*
* Wait up to 1 second to get the 100-continue response as needed...
*/