/*
- * "$Id: http.c 5753 2006-07-18 19:53:24Z mike $"
+ * "$Id: http.c 5889 2006-08-24 21:44:35Z mike $"
*
* HTTP routines for the Common UNIX Printing System (CUPS).
*
DEBUG_printf(("httpPrintf: %s", buf));
- if (http->wused)
+ if (http->data_encoding == HTTP_ENCODE_FIELDS)
+ return (httpWrite2(http, buf, bytes));
+ else
{
- DEBUG_puts(" flushing existing data...");
+ if (http->wused)
+ {
+ DEBUG_puts(" flushing existing data...");
- if (httpFlushWrite(http) < 0)
- return (-1);
- }
+ if (httpFlushWrite(http) < 0)
+ return (-1);
+ }
- return (http_write(http, buf, bytes));
+ return (http_write(http, buf, bytes));
+ }
}
httpFlushWrite(http);
}
- if ((length + http->wused) <= sizeof(http->wbuffer))
+ if ((length + http->wused) < sizeof(http->wbuffer))
{
/*
* Write to buffer...
if (httpReconnect(http))
return (-1);
+ /*
+ * Flush any written data that is pending...
+ */
+
+ if (http->wused)
+ httpFlushWrite(http);
+
/*
* Send the request header...
*/
- http->state = request;
+ http->state = request;
+ http->data_encoding = HTTP_ENCODE_FIELDS;
+
if (request == HTTP_POST || request == HTTP_PUT)
http->state ++;
return (-1);
}
+ httpFlushWrite(http);
httpGetLength2(http);
httpClearFields(http);
/*
- * End of "$Id: http.c 5753 2006-07-18 19:53:24Z mike $".
+ * End of "$Id: http.c 5889 2006-08-24 21:44:35Z mike $".
*/