]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/request.c
Load cups into easysw/current.
[thirdparty/cups.git] / cups / request.c
index 9a9161d3d6d1951f230a29bb1cf27a920309aac7..6aff5126d84451bf179bd48330c1edd1f910304b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$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).
  *
@@ -69,7 +69,8 @@ cupsDoFileRequest(http_t     *http,   /* I - HTTP connection to server */
   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",
@@ -146,6 +147,7 @@ cupsDoFileRequest(http_t     *http, /* I - HTTP connection to server */
 
   response = NULL;
   status   = HTTP_ERROR;
+  expect   = HTTP_CONTINUE;
 
   while (response == NULL)
   {
@@ -163,7 +165,7 @@ cupsDoFileRequest(http_t     *http, /* I - HTTP connection to server */
     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));
 
@@ -312,6 +314,14 @@ cupsDoFileRequest(http_t     *http,        /* I - HTTP connection to server */
       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));
@@ -469,5 +479,5 @@ _cupsSetError(ipp_status_t status,  /* I - IPP status code */
 
 
 /*
- * 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 $".
  */