summaryrefslogtreecommitdiff
path: root/cups/request.c
diff options
context:
space:
mode:
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2009-04-08 03:17:45 +0000
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2009-04-08 03:17:45 +0000
commit38e73f87814ea3029636fb1850b0483884b3cbbe (patch)
tree02f8956b05684064f1b78b4ad9a192c370a18d52 /cups/request.c
parent94da7e344cb567db8e531e263f5f4ede0f989162 (diff)
Merge changes from CUPS 1.4svn-r8492.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@1378 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'cups/request.c')
-rw-r--r--cups/request.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/cups/request.c b/cups/request.c
index bf291eabf..8179e51cb 100644
--- a/cups/request.c
+++ b/cups/request.c
@@ -753,6 +753,9 @@ cupsWriteRequestData(
const char *buffer, /* I - Bytes to write */
size_t length) /* I - Number of bytes to write */
{
+ int wused; /* Previous bytes in buffer */
+
+
/*
* Get the default connection as needed...
*/
@@ -776,6 +779,8 @@ cupsWriteRequestData(
* Then write to the HTTP connection...
*/
+ wused = http->wused;
+
if (httpWrite2(http, buffer, length) < 0)
return (HTTP_ERROR);
@@ -783,10 +788,19 @@ cupsWriteRequestData(
* Finally, check if we have any pending data from the server...
*/
- if (httpCheck(http))
- return (httpUpdate(http));
- else
- return (HTTP_CONTINUE);
+ if (length > HTTP_MAX_BUFFER ||
+ http->wused < wused ||
+ (wused > 0 && http->wused == length))
+ {
+ /*
+ * We've written something to the server, so check for response data...
+ */
+
+ if (_httpWait(http, 0, 1))
+ return (httpUpdate(http));
+ }
+
+ return (HTTP_CONTINUE);
}