/*
- * "$Id: request.c 5447 2006-04-21 20:07:51Z mike $"
+ * "$Id: request.c 5556 2006-05-21 13:55:23Z mike $"
*
* IPP utilities for the Common UNIX Printing System (CUPS).
*
FILE *file; /* File to send */
struct stat fileinfo; /* File information */
int bytes; /* Number of bytes read/written */
- char buffer[65536]; /* Output buffer */
+ char buffer[32768]; /* Output buffer */
+ http_status_t expect; /* Expect: header to use */
DEBUG_printf(("cupsDoFileRequest(%p, %p, \'%s\', \'%s\')\n",
response = NULL;
status = HTTP_ERROR;
+ expect = HTTP_CONTINUE;
while (response == NULL)
{
httpSetLength(http, length);
httpSetField(http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
- httpSetExpect(http, HTTP_CONTINUE);
+ httpSetExpect(http, expect);
DEBUG_printf(("cupsDoFileRequest: authstring=\"%s\"\n", http->authstring));
continue;
}
#endif /* HAVE_SSL */
+ else if (status == HTTP_EXPECTATION_FAILED)
+ {
+ /*
+ * Don't try using the Expect: header the next time around...
+ */
+
+ expect = (http_status_t)0;
+ }
else if (status != HTTP_OK)
{
DEBUG_printf(("cupsDoFileRequest: error %d...\n", status));
/*
- * End of "$Id: request.c 5447 2006-04-21 20:07:51Z mike $".
+ * End of "$Id: request.c 5556 2006-05-21 13:55:23Z mike $".
*/