]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/request.c
Merge changes from CUPS 1.4svn-r8628.
[thirdparty/cups.git] / cups / request.c
index bab7c7e66c94c157c6479fd5deec30ef730ebc3f..2d1107676b7c885df9d40aa2cbb29cc31d6ff23d 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: request.c 6879 2007-08-29 20:26:50Z mike $"
+ * "$Id: request.c 7946 2008-09-16 23:27:54Z mike $"
  *
  *   IPP utilities for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 2007-2008 by Apple Inc.
+ *   Copyright 2007-2009 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -65,6 +65,11 @@ cupsDoFileRequest(http_t     *http,  /* I - Connection to server or @code CUPS_HT
   int          infile;                 /* Input file */
 
 
+  DEBUG_printf(("cupsDoFileRequest(http=%p, request=%p(%s), resource=\"%s\", "
+                "filename=\"%s\")", http, request,
+               request ? ippOpString(request->request.op.operation_id) : "?",
+               resource, filename));
+
   if (filename)
   {
     if ((infile = open(filename, O_RDONLY | O_BINARY)) < 0)
@@ -74,7 +79,7 @@ cupsDoFileRequest(http_t     *http,   /* I - Connection to server or @code CUPS_HT
       */
 
       _cupsSetError(errno == ENOENT ? IPP_NOT_FOUND : IPP_NOT_AUTHORIZED,
-                    strerror(errno));
+                    NULL, 0);
 
       ippDelete(request);
 
@@ -106,7 +111,7 @@ cupsDoFileRequest(http_t     *http, /* I - Connection to server or @code CUPS_HT
  * If "outfile" is a valid file descriptor, cupsDoIORequest() copies
  * all of the data after the IPP response message to the file.
  *
- * @since CUPS 1.3@
+ * @since CUPS 1.3/Mac OS X 10.5@
  */
 
 ipp_t *                                        /* O - Response data */
@@ -124,9 +129,10 @@ cupsDoIORequest(http_t     *http,  /* I - Connection to server or @code CUPS_HTTP
   char         buffer[32768];          /* Output buffer */
 
 
-  DEBUG_printf(("cupsDoIORequest(http=%p, request=%p, resource=\"%s\""
-                "infile=%d, outfile=%d)\n", http, request,
-               resource ? resource : "(null)", infile, outfile));
+  DEBUG_printf(("cupsDoIORequest(http=%p, request=%p(%s), resource=\"%s\", "
+                "infile=%d, outfile=%d)", http, request,
+               request ? ippOpString(request->request.op.operation_id) : "?",
+               resource, infile, outfile));
 
  /*
   * Range check input...
@@ -136,7 +142,7 @@ cupsDoIORequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
   {
     ippDelete(request);
 
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL));
+    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
 
     return (NULL);
   }
@@ -146,7 +152,8 @@ cupsDoIORequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
   */
 
   if (!http)
-    http = _cupsConnect();
+    if ((http = _cupsConnect()) == NULL)
+      return (NULL);
 
  /*
   * See if we have a file to send...
@@ -161,7 +168,7 @@ cupsDoIORequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
       */
 
       _cupsSetError(errno == EBADF ? IPP_NOT_FOUND : IPP_NOT_AUTHORIZED,
-                    strerror(errno));
+                    NULL, 0);
 
       ippDelete(request);
 
@@ -180,7 +187,7 @@ cupsDoIORequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
 
       ippDelete(request);
 
-      _cupsSetError(IPP_NOT_POSSIBLE, strerror(EISDIR));
+      _cupsSetError(IPP_NOT_POSSIBLE, strerror(EISDIR), 0);
 
       return (NULL);
     }
@@ -195,13 +202,23 @@ cupsDoIORequest(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
   else
     length = ippLength(request);
 
+  DEBUG_printf(("2cupsDoIORequest: Request length=%ld, total length=%ld",
+                (long)ippLength(request), (long)length));
+
+ /*
+  * Clear any "Local" authentication data since it is probably stale...
+  */
+
+  if (http->authstring && !strncmp(http->authstring, "Local ", 6))
+    httpSetAuthString(http, NULL, NULL);
+
  /*
   * Loop until we can send the request without authorization problems.
   */
 
   while (response == NULL)
   {
-    DEBUG_puts("cupsDoFileRequest: setup...");
+    DEBUG_puts("2cupsDoIORequest: setup...");
 
    /*
     * Send the request...
@@ -209,11 +226,11 @@ cupsDoIORequest(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
 
     status = cupsSendRequest(http, request, resource, length);
 
-    DEBUG_printf(("cupsDoFileRequest: status=%d\n", status));
+    DEBUG_printf(("2cupsDoIORequest: status=%d", status));
 
     if (status == HTTP_CONTINUE && request->state == IPP_DATA && infile >= 0)
     {
-      DEBUG_puts("cupsDoFileRequest: file write...");
+      DEBUG_puts("2cupsDoIORequest: file write...");
 
      /*
       * Send the file with the request...
@@ -247,8 +264,14 @@ cupsDoIORequest(http_t     *http,  /* I - Connection to server or @code CUPS_HTTP
       status   = http->status;
     }
 
-    if (status == HTTP_FORBIDDEN)
+    DEBUG_printf(("2cupsDoIORequest: status=%d", status));
+
+    if (status == HTTP_FORBIDDEN || status == HTTP_ERROR ||
+       status >= HTTP_SERVER_ERROR)
+    {
+      _cupsSetHTTPError(status);
       break;
+    }
 
     if (response)
     {
@@ -296,7 +319,12 @@ cupsDoRequest(http_t     *http,            /* I - Connection to server or @code CUPS_HTTP_
               ipp_t      *request,     /* I - IPP request */
               const char *resource)    /* I - HTTP resource for POST */
 {
-  return (cupsDoFileRequest(http, request, resource, NULL));
+  DEBUG_printf(("cupsDoRequest(http=%p, request=%p(%s), resource=\"%s\")",
+                http, request,
+               request ? ippOpString(request->request.op.operation_id) : "?",
+               resource));
+
+  return (cupsDoIORequest(http, request, resource, -1, -1));
 }
 
 
@@ -307,7 +335,7 @@ cupsDoRequest(http_t     *http,             /* I - Connection to server or @code CUPS_HTTP_
  * cupsSendDocument() or cupsSendRequest(). For requests that return
  * additional data, use httpRead() after getting a successful response.
  *
- * @since CUPS 1.4@
+ * @since CUPS 1.4/Mac OS X 10.6@
  */
 
 ipp_t *                                        /* O - Response or @code NULL@ on HTTP error */
@@ -319,7 +347,7 @@ cupsGetResponse(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
   ipp_t                *response = NULL;       /* IPP response */
 
 
-  DEBUG_printf(("cupsGetReponse(http=%p)\n", http));
+  DEBUG_printf(("cupsGetResponse(http=%p, resource=\"%s\")", http, resource));
 
  /*
   * Connect to the default server as needed...
@@ -341,7 +369,7 @@ cupsGetResponse(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
     * Send a 0-length chunk to finish off the request...
     */
 
-    DEBUG_puts("cupsGetResponse: Finishing chunked POST...");
+    DEBUG_puts("2cupsGetResponse: Finishing chunked POST...");
 
     if (httpWrite2(http, "", 0) < 0)
       return (NULL);
@@ -351,12 +379,14 @@ cupsGetResponse(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
   * Wait for a response from the server...
   */
 
-  DEBUG_puts("cupsGetResponse: update...");
+  DEBUG_printf(("2cupsGetResponse: Update loop, http->status=%d...",
+                http->status));
 
-  while ((status = httpUpdate(http)) == HTTP_CONTINUE)
-    /* Do nothing but update */;
+  status = http->status;
+  while (status == HTTP_CONTINUE)
+    status = httpUpdate(http);
 
-  DEBUG_printf(("cupsGetResponse: status = %d\n", status));
+  DEBUG_printf(("2cupsGetResponse: status=%d", status));
 
   if (status == HTTP_OK)
   {
@@ -376,12 +406,12 @@ cupsGetResponse(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
       * Delete the response...
       */
 
-      DEBUG_puts("IPP read error!");
+      DEBUG_puts("1cupsGetResponse: IPP read error!");
 
       ippDelete(response);
       response = NULL;
 
-      _cupsSetError(IPP_SERVICE_UNAVAILABLE, strerror(errno));
+      _cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
     }
   }
   else if (status != HTTP_ERROR)
@@ -402,14 +432,12 @@ cupsGetResponse(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
       * See if we can do authentication...
       */
 
-      int auth_result;
+      DEBUG_puts("2cupsGetResponse: Need authorization...");
 
-      DEBUG_puts("cupsGetResponse: Need authorization...");
-
-      if ((auth_result =cupsDoAuthentication(http, "POST", resource)) == 0)
+      if (!cupsDoAuthentication(http, "POST", resource))
        httpReconnect(http);
-      else if (auth_result < 0)
-        http->status = status = HTTP_FORBIDDEN;
+      else
+        status = HTTP_AUTHORIZATION_CANCELED;
     }
 
 #ifdef HAVE_SSL
@@ -419,7 +447,7 @@ cupsGetResponse(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
       * Force a reconnect with encryption...
       */
 
-      DEBUG_puts("cupsGetResponse: Need encryption...");
+      DEBUG_puts("2cupsGetResponse: Need encryption...");
 
       if (!httpReconnect(http))
         httpEncryption(http, HTTP_ENCRYPT_REQUIRED);
@@ -434,9 +462,13 @@ cupsGetResponse(http_t     *http,  /* I - Connection to server or @code CUPS_HTTP
 
     attr = ippFindAttribute(response, "status-message", IPP_TAG_TEXT);
 
+    DEBUG_printf(("1cupsGetResponse: status-code=%s, status-message=\"%s\"",
+                  ippErrorString(response->request.status.status_code),
+                  attr ? attr->values[0].string.text : ""));
+
     _cupsSetError(response->request.status.status_code,
-                   attr ? attr->values[0].string.text :
-                      ippErrorString(response->request.status.status_code));
+                  attr ? attr->values[0].string.text :
+                     ippErrorString(response->request.status.status_code), 0);
   }
   else if (status != HTTP_OK)
     _cupsSetHTTPError(status);
@@ -451,7 +483,7 @@ cupsGetResponse(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
  * This function is used after cupsGetResponse() to read the PPD or document
  * files for CUPS_GET_PPD and CUPS_GET_DOCUMENT requests, respectively.
  *
- * @since CUPS 1.4@
+ * @since CUPS 1.4/Mac OS X 10.6@
  */
 
 ssize_t                                        /* O - Bytes read, 0 on EOF, -1 on error */
@@ -464,6 +496,9 @@ cupsReadResponseData(
   * Get the default connection as needed...
   */
 
+  DEBUG_printf(("cupsReadResponseData(http=%p, buffer=%p, "
+                "length=" CUPS_LLFMT ")", http, buffer, CUPS_LLCAST length));
+
   if (!http)
   {
     _cups_globals_t *cg = _cupsGlobals();
@@ -471,7 +506,7 @@ cupsReadResponseData(
 
     if ((http = cg->http) == NULL)
     {
-      _cupsSetError(IPP_INTERNAL_ERROR, "No active connection");
+      _cupsSetError(IPP_INTERNAL_ERROR, _("No active connection"), 1);
       return (-1);
     }
   }
@@ -495,14 +530,14 @@ cupsReadResponseData(
  * Unlike cupsDoFileRequest(), cupsDoIORequest(), and cupsDoRequest(), the
  * request is not freed.
  *
- * @since CUPS 1.4@
+ * @since CUPS 1.4/Mac OS X 10.6@
  */
 
 http_status_t                          /* O - Initial HTTP status */
 cupsSendRequest(http_t     *http,      /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
                 ipp_t      *request,   /* I - IPP request */
                 const char *resource,  /* I - Resource path */
-               size_t     length)      /* I - Length of data to follow or CUPS_LENGTH_VARIABLE */
+               size_t     length)      /* I - Length of data to follow or @code CUPS_LENGTH_VARIABLE@ */
 {
   http_status_t        status;                 /* Status of HTTP request */
   int          got_status;             /* Did we get the status? */
@@ -510,9 +545,10 @@ cupsSendRequest(http_t     *http,  /* I - Connection to server or @code CUPS_HTTP
   http_status_t        expect;                 /* Expect: header to use */
 
 
-  DEBUG_printf(("cupsSendRequest(http=%p, request=%p, resource=\"%s\", "
-                "length=" CUPS_LLFMT ")\n", http, request,
-               resource ? resource : "(null)", CUPS_LLCAST length));
+  DEBUG_printf(("cupsSendRequest(http=%p, request=%p(%s), resource=\"%s\", "
+                "length=" CUPS_LLFMT ")", http, request,
+               request ? ippOpString(request->request.op.operation_id) : "?",
+               resource, CUPS_LLCAST length));
 
  /*
   * Range check input...
@@ -520,7 +556,7 @@ cupsSendRequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
 
   if (!request || !resource)
   {
-    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL));
+    _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
 
     return (HTTP_ERROR);
   }
@@ -530,7 +566,8 @@ cupsSendRequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
   */
 
   if (!http)
-    http = _cupsConnect();
+    if ((http = _cupsConnect()) == NULL)
+      return (HTTP_SERVICE_UNAVAILABLE);
 
 #ifdef HAVE_SSL
  /*
@@ -542,19 +579,32 @@ cupsSendRequest(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
   if (ippFindAttribute(request, "auth-info", IPP_TAG_TEXT) &&
       !httpAddrLocalhost(http->hostaddr) && !http->tls &&
       httpEncryption(http, HTTP_ENCRYPT_REQUIRED))
-    return (HTTP_ERROR);
+  {
+    _cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
+    return (HTTP_SERVICE_UNAVAILABLE);
+  }
 #endif /* HAVE_SSL */
 
+ /*
+  * Reconnect if the last response had a "Connection: close"...
+  */
+
+  if (!strcasecmp(http->fields[HTTP_FIELD_CONNECTION], "close"))
+    if (httpReconnect(http))
+    {
+      _cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
+      return (HTTP_SERVICE_UNAVAILABLE);
+    }
+
  /*
   * Loop until we can send the request without authorization problems.
   */
 
-  status = HTTP_ERROR;
   expect = HTTP_CONTINUE;
 
   for (;;)
   {
-    DEBUG_puts("cupsSendRequest: setup...");
+    DEBUG_puts("2cupsSendRequest: Setup...");
 
    /*
     * Setup the HTTP variables needed...
@@ -566,18 +616,21 @@ cupsSendRequest(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
     httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
     httpSetExpect(http, expect);
 
-    DEBUG_printf(("cupsSendRequest: authstring=\"%s\"\n", http->authstring));
+    DEBUG_printf(("2cupsSendRequest: authstring=\"%s\"", http->authstring));
 
    /*
     * Try the request...
     */
 
-    DEBUG_puts("cupsSendRequest: post...");
+    DEBUG_puts("2cupsSendRequest: Sending HTTP POST...");
 
     if (httpPost(http, resource))
     {
       if (httpReconnect(http))
-        return (HTTP_ERROR);
+      {
+        _cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
+        return (HTTP_SERVICE_UNAVAILABLE);
+      }
       else
         continue;
     }
@@ -586,7 +639,7 @@ cupsSendRequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
     * Send the IPP data...
     */
 
-    DEBUG_puts("cupsSendRequest: ipp write...");
+    DEBUG_puts("2cupsSendRequest: Writing IPP request...");
 
     request->state = IPP_IDLE;
     status         = HTTP_CONTINUE;
@@ -609,12 +662,16 @@ cupsSendRequest(http_t     *http, /* I - Connection to server or @code CUPS_HTTP
 
     if (!got_status && expect == HTTP_CONTINUE)
     {
+      DEBUG_puts("2cupsSendRequest: Waiting for 100-continue...");
+
       if (httpWait(http, 1000))
         status = httpUpdate(http);
     }
     else if (httpCheck(http))
       status = httpUpdate(http);
 
+    DEBUG_printf(("2cupsSendRequest: status=%d", status));
+
    /*
     * Process the current HTTP status...
     */
@@ -628,8 +685,15 @@ cupsSendRequest(http_t     *http,  /* I - Connection to server or @code CUPS_HTTP
 
       case HTTP_UNAUTHORIZED :
           if (!cupsDoAuthentication(http, "POST", resource))
+         {
            if (httpReconnect(http))
-             return (HTTP_ERROR);
+           {
+             _cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
+             return (HTTP_SERVICE_UNAVAILABLE);
+           }
+         }
+         else
+           status = HTTP_AUTHORIZATION_CANCELED;
 
           return (status);
 
@@ -641,7 +705,10 @@ cupsSendRequest(http_t     *http,  /* I - Connection to server or @code CUPS_HTTP
          */
 
          if (httpReconnect(http))
-           return (HTTP_ERROR);
+         {
+           _cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
+           return (HTTP_SERVICE_UNAVAILABLE);
+         }
 
          httpEncryption(http, HTTP_ENCRYPT_REQUIRED);
 
@@ -655,6 +722,13 @@ cupsSendRequest(http_t     *http,  /* I - Connection to server or @code CUPS_HTTP
 
          expect = (http_status_t)0;
 
+         if (httpReconnect(http))
+         {
+           _cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
+           return (HTTP_SERVICE_UNAVAILABLE);
+         }
+         break;
+
       default :
          /*
          * Some other error...
@@ -672,7 +746,7 @@ cupsSendRequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
  * This function is used after @link cupsSendRequest@ to provide a PPD and
  * after @link cupsStartDocument@ to provide a document file.
  *
- * @since CUPS 1.4@
+ * @since CUPS 1.4/Mac OS X 10.6@
  */
 
 http_status_t                          /* O - @code HTTP_CONTINUE@ if OK or HTTP status on error */
@@ -681,10 +755,16 @@ 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...
   */
 
+  DEBUG_printf(("cupsWriteRequestData(http=%p, buffer=%p, "
+                "length=" CUPS_LLFMT ")", http, buffer, CUPS_LLCAST length));
+
   if (!http)
   {
     _cups_globals_t *cg = _cupsGlobals();
@@ -692,7 +772,7 @@ cupsWriteRequestData(
 
     if ((http = cg->http) == NULL)
     {
-      _cupsSetError(IPP_INTERNAL_ERROR, "No active connection");
+      _cupsSetError(IPP_INTERNAL_ERROR, _("No active connection"), 1);
       return (HTTP_ERROR);
     }
   }
@@ -701,6 +781,8 @@ cupsWriteRequestData(
   * Then write to the HTTP connection...
   */
 
+  wused = http->wused;
+
   if (httpWrite2(http, buffer, length) < 0)
     return (HTTP_ERROR);
 
@@ -708,10 +790,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);
 }
 
 
@@ -721,23 +812,48 @@ cupsWriteRequestData(
 
 void
 _cupsSetError(ipp_status_t status,     /* I - IPP status code */
-               const char   *message)  /* I - status-message value */
+              const char   *message,   /* I - status-message value */
+             int          localize)    /* I - Localize the message? */
 {
   _cups_globals_t      *cg;            /* Global data */
 
 
+  if (!message && errno)
+  {
+    message  = strerror(errno);
+    localize = 0;
+  }
+
   cg             = _cupsGlobals();
   cg->last_error = status;
 
   if (cg->last_status_message)
   {
-    free(cg->last_status_message);
+    _cupsStrFree(cg->last_status_message);
 
     cg->last_status_message = NULL;
   }
 
   if (message)
-    cg->last_status_message = strdup(message);
+  {
+    if (localize)
+    {
+     /*
+      * Get the message catalog...
+      */
+
+      if (!cg->lang_default)
+       cg->lang_default = cupsLangDefault();
+
+      cg->last_status_message = _cupsStrAlloc(_cupsLangString(cg->lang_default,
+                                                              message));
+    }
+    else
+      cg->last_status_message = _cupsStrAlloc(message);
+  }
+
+  DEBUG_printf(("4_cupsSetError: last_error=%s, last_status_message=\"%s\"",
+                ippErrorString(cg->last_error), cg->last_status_message));
 }
 
 
@@ -751,42 +867,43 @@ _cupsSetHTTPError(http_status_t status)   /* I - HTTP status code */
   switch (status)
   {
     case HTTP_NOT_FOUND :
-       _cupsSetError(IPP_NOT_FOUND, httpStatus(status));
+       _cupsSetError(IPP_NOT_FOUND, httpStatus(status), 0);
        break;
 
     case HTTP_UNAUTHORIZED :
-       _cupsSetError(IPP_NOT_AUTHORIZED, httpStatus(status));
+    case HTTP_AUTHORIZATION_CANCELED :
+       _cupsSetError(IPP_NOT_AUTHORIZED, httpStatus(status), 0);
        break;
 
     case HTTP_FORBIDDEN :
-       _cupsSetError(IPP_FORBIDDEN, httpStatus(status));
+       _cupsSetError(IPP_FORBIDDEN, httpStatus(status), 0);
        break;
 
     case HTTP_BAD_REQUEST :
-       _cupsSetError(IPP_BAD_REQUEST, httpStatus(status));
+       _cupsSetError(IPP_BAD_REQUEST, httpStatus(status), 0);
        break;
 
     case HTTP_REQUEST_TOO_LARGE :
-       _cupsSetError(IPP_REQUEST_VALUE, httpStatus(status));
+       _cupsSetError(IPP_REQUEST_VALUE, httpStatus(status), 0);
        break;
 
     case HTTP_NOT_IMPLEMENTED :
-       _cupsSetError(IPP_OPERATION_NOT_SUPPORTED, httpStatus(status));
+       _cupsSetError(IPP_OPERATION_NOT_SUPPORTED, httpStatus(status), 0);
        break;
 
     case HTTP_NOT_SUPPORTED :
-       _cupsSetError(IPP_VERSION_NOT_SUPPORTED, httpStatus(status));
+       _cupsSetError(IPP_VERSION_NOT_SUPPORTED, httpStatus(status), 0);
        break;
 
     default :
-       DEBUG_printf(("HTTP error %d mapped to IPP_SERVICE_UNAVAILABLE!\n",
-                     status));
-       _cupsSetError(IPP_SERVICE_UNAVAILABLE, httpStatus(status));
+       DEBUG_printf(("4_cupsSetHTTPError: HTTP error %d mapped to "
+                     "IPP_SERVICE_UNAVAILABLE!", status));
+       _cupsSetError(IPP_SERVICE_UNAVAILABLE, httpStatus(status), 0);
        break;
   }
 }
 
 
 /*
- * End of "$Id: request.c 6879 2007-08-29 20:26:50Z mike $".
+ * End of "$Id: request.c 7946 2008-09-16 23:27:54Z mike $".
  */