2 * "$Id: request.c 7946 2008-09-16 23:27:54Z mike $"
4 * IPP utilities for CUPS.
6 * Copyright 2007-2011 by Apple Inc.
7 * Copyright 1997-2007 by Easy Software Products.
9 * These coded instructions, statements, and computer programs are the
10 * property of Apple Inc. and are protected by Federal copyright
11 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 * which should have been included with this file. If this file is
13 * file is missing or damaged, see the license at "http://www.cups.org/".
15 * This file is subject to the Apple OS-Developed Software exception.
19 * cupsDoFileRequest() - Do an IPP request with a file.
20 * cupsDoIORequest() - Do an IPP request with file descriptors.
21 * cupsDoRequest() - Do an IPP request.
22 * cupsGetResponse() - Get a response to an IPP request.
23 * cupsLastError() - Return the last IPP status code.
24 * cupsLastErrorString() - Return the last IPP status-message.
25 * cupsReadResponseData() - Read additional data after the IPP response.
26 * cupsSendRequest() - Send an IPP request.
27 * cupsWriteRequestData() - Write additional data after an IPP request.
28 * _cupsConnect() - Get the default server connection...
29 * _cupsSetError() - Set the last IPP status code and status-message.
30 * _cupsSetHTTPError() - Set the last error using the HTTP status.
34 * Include necessary headers...
37 #include "cups-private.h"
40 #if defined(WIN32) || defined(__EMX__)
44 #endif /* WIN32 || __EMX__ */
51 * 'cupsDoFileRequest()' - Do an IPP request with a file.
53 * This function sends the IPP request to the specified server, retrying
54 * and authenticating as necessary. The request is freed with @link ippDelete@
55 * after receiving a valid IPP response.
58 ipp_t
* /* O - Response data */
59 cupsDoFileRequest(http_t
*http
, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
60 ipp_t
*request
, /* I - IPP request */
61 const char *resource
, /* I - HTTP resource for POST */
62 const char *filename
) /* I - File to send or @code NULL@ for none */
64 ipp_t
*response
; /* IPP response data */
65 int infile
; /* Input file */
68 DEBUG_printf(("cupsDoFileRequest(http=%p, request=%p(%s), resource=\"%s\", "
69 "filename=\"%s\")", http
, request
,
70 request
? ippOpString(request
->request
.op
.operation_id
) : "?",
75 if ((infile
= open(filename
, O_RDONLY
| O_BINARY
)) < 0)
78 * Can't get file information!
81 _cupsSetError(errno
== ENOENT
? IPP_NOT_FOUND
: IPP_NOT_AUTHORIZED
,
92 response
= cupsDoIORequest(http
, request
, resource
, infile
, -1);
102 * 'cupsDoIORequest()' - Do an IPP request with file descriptors.
104 * This function sends the IPP request to the specified server, retrying
105 * and authenticating as necessary. The request is freed with ippDelete()
106 * after receiving a valid IPP response.
108 * If "infile" is a valid file descriptor, cupsDoIORequest() copies
109 * all of the data from the file after the IPP request message.
111 * If "outfile" is a valid file descriptor, cupsDoIORequest() copies
112 * all of the data after the IPP response message to the file.
114 * @since CUPS 1.3/Mac OS X 10.5@
117 ipp_t
* /* O - Response data */
118 cupsDoIORequest(http_t
*http
, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
119 ipp_t
*request
, /* I - IPP request */
120 const char *resource
, /* I - HTTP resource for POST */
121 int infile
, /* I - File to read from or -1 for none */
122 int outfile
) /* I - File to write to or -1 for none */
124 ipp_t
*response
= NULL
; /* IPP response data */
125 size_t length
= 0; /* Content-Length value */
126 http_status_t status
; /* Status of HTTP request */
127 struct stat fileinfo
; /* File information */
128 int bytes
; /* Number of bytes read/written */
129 char buffer
[32768]; /* Output buffer */
132 DEBUG_printf(("cupsDoIORequest(http=%p, request=%p(%s), resource=\"%s\", "
133 "infile=%d, outfile=%d)", http
, request
,
134 request
? ippOpString(request
->request
.op
.operation_id
) : "?",
135 resource
, infile
, outfile
));
138 * Range check input...
141 if (!request
|| !resource
)
145 _cupsSetError(IPP_INTERNAL_ERROR
, strerror(EINVAL
), 0);
151 * Get the default connection as needed...
155 if ((http
= _cupsConnect()) == NULL
)
163 * See if we have a file to send...
168 if (fstat(infile
, &fileinfo
))
171 * Can't get file information!
174 _cupsSetError(errno
== EBADF
? IPP_NOT_FOUND
: IPP_NOT_AUTHORIZED
,
183 if (fileinfo
.st_mode
& _S_IFDIR
)
185 if (S_ISDIR(fileinfo
.st_mode
))
189 * Can't send a directory...
194 _cupsSetError(IPP_NOT_POSSIBLE
, strerror(EISDIR
), 0);
200 if (!S_ISREG(fileinfo
.st_mode
))
201 length
= 0; /* Chunk when piping */
204 length
= ippLength(request
) + fileinfo
.st_size
;
207 length
= ippLength(request
);
209 DEBUG_printf(("2cupsDoIORequest: Request length=%ld, total length=%ld",
210 (long)ippLength(request
), (long)length
));
213 * Clear any "Local" authentication data since it is probably stale...
216 if (http
->authstring
&& !strncmp(http
->authstring
, "Local ", 6))
217 httpSetAuthString(http
, NULL
, NULL
);
220 * Loop until we can send the request without authorization problems.
223 while (response
== NULL
)
225 DEBUG_puts("2cupsDoIORequest: setup...");
228 * Send the request...
231 status
= cupsSendRequest(http
, request
, resource
, length
);
233 DEBUG_printf(("2cupsDoIORequest: status=%d", status
));
235 if (status
== HTTP_CONTINUE
&& request
->state
== IPP_DATA
&& infile
>= 0)
237 DEBUG_puts("2cupsDoIORequest: file write...");
240 * Send the file with the request...
244 if (S_ISREG(fileinfo
.st_mode
))
246 lseek(infile
, 0, SEEK_SET
);
248 while ((bytes
= (int)read(infile
, buffer
, sizeof(buffer
))) > 0)
252 _httpUpdate(http
, &status
);
254 if (status
>= HTTP_MULTIPLE_CHOICES
)
258 if (httpWrite2(http
, buffer
, bytes
) < bytes
)
264 * Get the server's response...
267 if (status
== HTTP_CONTINUE
|| status
== HTTP_OK
)
269 response
= cupsGetResponse(http
, resource
);
270 status
= http
->status
;
275 DEBUG_printf(("2cupsDoIORequest: status=%d", status
));
277 if (status
== HTTP_ERROR
||
278 (status
>= HTTP_BAD_REQUEST
&& status
!= HTTP_UNAUTHORIZED
&&
279 status
!= HTTP_UPGRADE_REQUIRED
))
281 _cupsSetHTTPError(status
);
290 * Write trailing data to file...
293 while ((bytes
= (int)httpRead2(http
, buffer
, sizeof(buffer
))) > 0)
294 if (write(outfile
, buffer
, bytes
) < bytes
)
300 * Flush any remaining data...
309 * Delete the original request and return the response...
319 * 'cupsDoRequest()' - Do an IPP request.
321 * This function sends the IPP request to the specified server, retrying
322 * and authenticating as necessary. The request is freed with ippDelete()
323 * after receiving a valid IPP response.
326 ipp_t
* /* O - Response data */
327 cupsDoRequest(http_t
*http
, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
328 ipp_t
*request
, /* I - IPP request */
329 const char *resource
) /* I - HTTP resource for POST */
331 DEBUG_printf(("cupsDoRequest(http=%p, request=%p(%s), resource=\"%s\")",
333 request
? ippOpString(request
->request
.op
.operation_id
) : "?",
336 return (cupsDoIORequest(http
, request
, resource
, -1, -1));
341 * 'cupsGetResponse()' - Get a response to an IPP request.
343 * Use this function to get the response for an IPP request sent using
344 * cupsSendDocument() or cupsSendRequest(). For requests that return
345 * additional data, use httpRead() after getting a successful response.
347 * @since CUPS 1.4/Mac OS X 10.6@
350 ipp_t
* /* O - Response or @code NULL@ on HTTP error */
351 cupsGetResponse(http_t
*http
, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
352 const char *resource
) /* I - HTTP resource for POST */
354 http_status_t status
; /* HTTP status */
355 ipp_state_t state
; /* IPP read state */
356 ipp_t
*response
= NULL
; /* IPP response */
359 DEBUG_printf(("cupsGetResponse(http=%p, resource=\"%s\")", http
, resource
));
362 * Connect to the default server as needed...
366 http
= _cupsConnect();
368 if (!http
|| (http
->state
!= HTTP_POST_RECV
&& http
->state
!= HTTP_POST_SEND
))
372 * Check for an unfinished chunked request...
375 if (http
->data_encoding
== HTTP_ENCODE_CHUNKED
)
378 * Send a 0-length chunk to finish off the request...
381 DEBUG_puts("2cupsGetResponse: Finishing chunked POST...");
383 if (httpWrite2(http
, "", 0) < 0)
388 * Wait for a response from the server...
391 DEBUG_printf(("2cupsGetResponse: Update loop, http->status=%d...",
396 status
= httpUpdate(http
);
398 while (http
->state
== HTTP_POST_RECV
);
400 DEBUG_printf(("2cupsGetResponse: status=%d", status
));
402 if (status
== HTTP_OK
)
405 * Get the IPP response...
410 while ((state
= ippRead(http
, response
)) != IPP_DATA
)
411 if (state
== IPP_ERROR
)
414 if (state
== IPP_ERROR
)
417 * Delete the response...
420 DEBUG_puts("1cupsGetResponse: IPP read error!");
425 _cupsSetError(IPP_SERVICE_UNAVAILABLE
, NULL
, 0);
428 else if (status
!= HTTP_ERROR
)
431 * Flush any error message...
437 * Then handle encryption and authentication...
440 if (status
== HTTP_UNAUTHORIZED
)
443 * See if we can do authentication...
446 DEBUG_puts("2cupsGetResponse: Need authorization...");
448 if (!cupsDoAuthentication(http
, "POST", resource
))
451 status
= HTTP_AUTHORIZATION_CANCELED
;
455 else if (status
== HTTP_UPGRADE_REQUIRED
)
458 * Force a reconnect with encryption...
461 DEBUG_puts("2cupsGetResponse: Need encryption...");
463 if (!httpReconnect(http
))
464 httpEncryption(http
, HTTP_ENCRYPT_REQUIRED
);
466 #endif /* HAVE_SSL */
471 ipp_attribute_t
*attr
; /* status-message attribute */
474 attr
= ippFindAttribute(response
, "status-message", IPP_TAG_TEXT
);
476 DEBUG_printf(("1cupsGetResponse: status-code=%s, status-message=\"%s\"",
477 ippErrorString(response
->request
.status
.status_code
),
478 attr
? attr
->values
[0].string
.text
: ""));
480 _cupsSetError(response
->request
.status
.status_code
,
481 attr
? attr
->values
[0].string
.text
:
482 ippErrorString(response
->request
.status
.status_code
), 0);
484 else if (status
!= HTTP_OK
)
485 _cupsSetHTTPError(status
);
492 * 'cupsLastError()' - Return the last IPP status code.
495 ipp_status_t
/* O - IPP status code from last request */
498 return (_cupsGlobals()->last_error
);
503 * 'cupsLastErrorString()' - Return the last IPP status-message.
505 * @since CUPS 1.2/Mac OS X 10.5@
508 const char * /* O - status-message text from last request */
509 cupsLastErrorString(void)
511 return (_cupsGlobals()->last_status_message
);
516 * 'cupsReadResponseData()' - Read additional data after the IPP response.
518 * This function is used after cupsGetResponse() to read the PPD or document
519 * files for CUPS_GET_PPD and CUPS_GET_DOCUMENT requests, respectively.
521 * @since CUPS 1.4/Mac OS X 10.6@
524 ssize_t
/* O - Bytes read, 0 on EOF, -1 on error */
525 cupsReadResponseData(
526 http_t
*http
, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
527 char *buffer
, /* I - Buffer to use */
528 size_t length
) /* I - Number of bytes to read */
531 * Get the default connection as needed...
534 DEBUG_printf(("cupsReadResponseData(http=%p, buffer=%p, "
535 "length=" CUPS_LLFMT
")", http
, buffer
, CUPS_LLCAST length
));
539 _cups_globals_t
*cg
= _cupsGlobals();
540 /* Pointer to library globals */
542 if ((http
= cg
->http
) == NULL
)
544 _cupsSetError(IPP_INTERNAL_ERROR
, _("No active connection"), 1);
550 * Then read from the HTTP connection...
553 return (httpRead2(http
, buffer
, length
));
558 * 'cupsSendRequest()' - Send an IPP request.
560 * Use httpWrite() to write any additional data (document, PPD file, etc.)
561 * for the request, cupsGetResponse() to get the IPP response, and httpRead()
562 * to read any additional data following the response. Only one request can be
563 * sent/queued at a time.
565 * Unlike cupsDoFileRequest(), cupsDoIORequest(), and cupsDoRequest(), the
566 * request is not freed.
568 * @since CUPS 1.4/Mac OS X 10.6@
571 http_status_t
/* O - Initial HTTP status */
572 cupsSendRequest(http_t
*http
, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
573 ipp_t
*request
, /* I - IPP request */
574 const char *resource
, /* I - Resource path */
575 size_t length
) /* I - Length of data to follow or @code CUPS_LENGTH_VARIABLE@ */
577 http_status_t status
; /* Status of HTTP request */
578 int got_status
; /* Did we get the status? */
579 ipp_state_t state
; /* State of IPP processing */
580 http_status_t expect
; /* Expect: header to use */
583 DEBUG_printf(("cupsSendRequest(http=%p, request=%p(%s), resource=\"%s\", "
584 "length=" CUPS_LLFMT
")", http
, request
,
585 request
? ippOpString(request
->request
.op
.operation_id
) : "?",
586 resource
, CUPS_LLCAST length
));
589 * Range check input...
592 if (!request
|| !resource
)
594 _cupsSetError(IPP_INTERNAL_ERROR
, strerror(EINVAL
), 0);
600 * Get the default connection as needed...
604 if ((http
= _cupsConnect()) == NULL
)
605 return (HTTP_SERVICE_UNAVAILABLE
);
609 * See if we have an auth-info attribute and are communicating over
610 * a non-local link. If so, encrypt the link so that we can pass
611 * the authentication information securely...
614 if (ippFindAttribute(request
, "auth-info", IPP_TAG_TEXT
) &&
615 !httpAddrLocalhost(http
->hostaddr
) && !http
->tls
&&
616 httpEncryption(http
, HTTP_ENCRYPT_REQUIRED
))
618 _cupsSetError(IPP_SERVICE_UNAVAILABLE
, NULL
, 0);
619 return (HTTP_SERVICE_UNAVAILABLE
);
621 #endif /* HAVE_SSL */
624 * Reconnect if the last response had a "Connection: close"...
627 if (!strcasecmp(http
->fields
[HTTP_FIELD_CONNECTION
], "close"))
628 if (httpReconnect(http
))
630 _cupsSetError(IPP_SERVICE_UNAVAILABLE
, NULL
, 0);
631 return (HTTP_SERVICE_UNAVAILABLE
);
635 * Loop until we can send the request without authorization problems.
638 expect
= HTTP_CONTINUE
;
642 DEBUG_puts("2cupsSendRequest: Setup...");
645 * Setup the HTTP variables needed...
648 httpClearFields(http
);
649 httpSetExpect(http
, expect
);
650 httpSetField(http
, HTTP_FIELD_CONTENT_TYPE
, "application/ipp");
651 httpSetLength(http
, length
);
654 if (http
->authstring
&& !strncmp(http
->authstring
, "Negotiate", 9))
657 * Do not use cached Kerberos credentials since they will look like a
661 cupsDoAuthentication(http
, "POST", resource
);
664 #endif /* HAVE_GSSAPI */
665 httpSetField(http
, HTTP_FIELD_AUTHORIZATION
, http
->authstring
);
667 DEBUG_printf(("2cupsSendRequest: authstring=\"%s\"", http
->authstring
));
673 DEBUG_puts("2cupsSendRequest: Sending HTTP POST...");
675 if (httpPost(http
, resource
))
677 if (httpReconnect(http
))
679 _cupsSetError(IPP_SERVICE_UNAVAILABLE
, NULL
, 0);
680 return (HTTP_SERVICE_UNAVAILABLE
);
687 * Send the IPP data...
690 DEBUG_puts("2cupsSendRequest: Writing IPP request...");
692 request
->state
= IPP_IDLE
;
693 status
= HTTP_CONTINUE
;
696 while ((state
= ippWrite(http
, request
)) != IPP_DATA
)
697 if (state
== IPP_ERROR
)
699 else if (httpCheck(http
))
703 _httpUpdate(http
, &status
);
704 if (status
>= HTTP_MULTIPLE_CHOICES
)
709 * Wait up to 1 second to get the 100-continue response as needed...
714 if (expect
== HTTP_CONTINUE
)
716 DEBUG_puts("2cupsSendRequest: Waiting for 100-continue...");
718 if (httpWait(http
, 1000))
719 _httpUpdate(http
, &status
);
721 else if (httpCheck(http
))
722 _httpUpdate(http
, &status
);
725 DEBUG_printf(("2cupsSendRequest: status=%d", status
));
728 * Process the current HTTP status...
731 if (status
>= HTTP_MULTIPLE_CHOICES
)
741 case HTTP_UNAUTHORIZED
:
742 if (cupsDoAuthentication(http
, "POST", resource
))
743 return (HTTP_AUTHORIZATION_CANCELED
);
745 if (httpReconnect(http
))
747 _cupsSetError(IPP_SERVICE_UNAVAILABLE
, NULL
, 0);
748 return (HTTP_SERVICE_UNAVAILABLE
);
753 case HTTP_UPGRADE_REQUIRED
:
755 * Flush any error message, reconnect, and then upgrade with
759 if (httpReconnect(http
))
761 _cupsSetError(IPP_SERVICE_UNAVAILABLE
, NULL
, 0);
762 return (HTTP_SERVICE_UNAVAILABLE
);
765 if (httpEncryption(http
, HTTP_ENCRYPT_REQUIRED
))
767 _cupsSetError(IPP_SERVICE_UNAVAILABLE
, NULL
, 0);
768 return (HTTP_SERVICE_UNAVAILABLE
);
771 #endif /* HAVE_SSL */
773 case HTTP_EXPECTATION_FAILED
:
775 * Don't try using the Expect: header the next time around...
778 expect
= (http_status_t
)0;
780 if (httpReconnect(http
))
782 _cupsSetError(IPP_SERVICE_UNAVAILABLE
, NULL
, 0);
783 return (HTTP_SERVICE_UNAVAILABLE
);
789 * Some other error...
799 * 'cupsWriteRequestData()' - Write additional data after an IPP request.
801 * This function is used after @link cupsSendRequest@ to provide a PPD and
802 * after @link cupsStartDocument@ to provide a document file.
804 * @since CUPS 1.4/Mac OS X 10.6@
807 http_status_t
/* O - @code HTTP_CONTINUE@ if OK or HTTP status on error */
808 cupsWriteRequestData(
809 http_t
*http
, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
810 const char *buffer
, /* I - Bytes to write */
811 size_t length
) /* I - Number of bytes to write */
813 int wused
; /* Previous bytes in buffer */
817 * Get the default connection as needed...
820 DEBUG_printf(("cupsWriteRequestData(http=%p, buffer=%p, "
821 "length=" CUPS_LLFMT
")", http
, buffer
, CUPS_LLCAST length
));
825 _cups_globals_t
*cg
= _cupsGlobals();
826 /* Pointer to library globals */
828 if ((http
= cg
->http
) == NULL
)
830 _cupsSetError(IPP_INTERNAL_ERROR
, _("No active connection"), 1);
831 DEBUG_puts("1cupsWriteRequestData: Returning HTTP_ERROR.");
837 * Then write to the HTTP connection...
842 if (httpWrite2(http
, buffer
, length
) < 0)
844 DEBUG_puts("1cupsWriteRequestData: Returning HTTP_ERROR.");
845 _cupsSetError(IPP_INTERNAL_ERROR
, strerror(http
->error
), 0);
850 * Finally, check if we have any pending data from the server...
853 if (length
>= HTTP_MAX_BUFFER
||
854 http
->wused
< wused
||
855 (wused
> 0 && http
->wused
== length
))
858 * We've written something to the server, so check for response data...
861 if (_httpWait(http
, 0, 1))
863 http_status_t status
; /* Status from _httpUpdate */
865 _httpUpdate(http
, &status
);
866 if (status
>= HTTP_MULTIPLE_CHOICES
)
868 _cupsSetHTTPError(status
);
872 DEBUG_printf(("1cupsWriteRequestData: Returning %d.\n", status
));
877 DEBUG_puts("1cupsWriteRequestData: Returning HTTP_CONTINUE.");
878 return (HTTP_CONTINUE
);
883 * '_cupsConnect()' - Get the default server connection...
886 http_t
* /* O - HTTP connection */
889 _cups_globals_t
*cg
= _cupsGlobals(); /* Pointer to library globals */
893 * See if we are connected to the same server...
899 * Compare the connection hostname, port, and encryption settings to
900 * the cached defaults; these were initialized the first time we
904 if (strcmp(cg
->http
->hostname
, cg
->server
) ||
905 cg
->ipp_port
!= _httpAddrPort(cg
->http
->hostaddr
) ||
906 (cg
->http
->encryption
!= cg
->encryption
&&
907 cg
->http
->encryption
== HTTP_ENCRYPT_NEVER
))
910 * Need to close the current connection because something has changed...
919 * (Re)connect as needed...
924 if ((cg
->http
= httpConnectEncrypt(cupsServer(), ippPort(),
925 cupsEncryption())) == NULL
)
928 _cupsSetError(IPP_SERVICE_UNAVAILABLE
, NULL
, 0);
930 _cupsSetError(IPP_SERVICE_UNAVAILABLE
,
931 _("Unable to connect to host."), 1);
936 * Return the cached connection...
944 * '_cupsSetError()' - Set the last IPP status code and status-message.
948 _cupsSetError(ipp_status_t status
, /* I - IPP status code */
949 const char *message
, /* I - status-message value */
950 int localize
) /* I - Localize the message? */
952 _cups_globals_t
*cg
; /* Global data */
955 if (!message
&& errno
)
957 message
= strerror(errno
);
962 cg
->last_error
= status
;
964 if (cg
->last_status_message
)
966 _cupsStrFree(cg
->last_status_message
);
968 cg
->last_status_message
= NULL
;
976 * Get the message catalog...
979 if (!cg
->lang_default
)
980 cg
->lang_default
= cupsLangDefault();
982 cg
->last_status_message
= _cupsStrAlloc(_cupsLangString(cg
->lang_default
,
986 cg
->last_status_message
= _cupsStrAlloc(message
);
989 DEBUG_printf(("4_cupsSetError: last_error=%s, last_status_message=\"%s\"",
990 ippErrorString(cg
->last_error
), cg
->last_status_message
));
995 * '_cupsSetHTTPError()' - Set the last error using the HTTP status.
999 _cupsSetHTTPError(http_status_t status
) /* I - HTTP status code */
1003 case HTTP_NOT_FOUND
:
1004 _cupsSetError(IPP_NOT_FOUND
, httpStatus(status
), 0);
1007 case HTTP_UNAUTHORIZED
:
1008 _cupsSetError(IPP_NOT_AUTHENTICATED
, httpStatus(status
), 0);
1011 case HTTP_AUTHORIZATION_CANCELED
:
1012 _cupsSetError(IPP_AUTHENTICATION_CANCELED
, httpStatus(status
), 0);
1015 case HTTP_FORBIDDEN
:
1016 _cupsSetError(IPP_FORBIDDEN
, httpStatus(status
), 0);
1019 case HTTP_BAD_REQUEST
:
1020 _cupsSetError(IPP_BAD_REQUEST
, httpStatus(status
), 0);
1023 case HTTP_REQUEST_TOO_LARGE
:
1024 _cupsSetError(IPP_REQUEST_VALUE
, httpStatus(status
), 0);
1027 case HTTP_NOT_IMPLEMENTED
:
1028 _cupsSetError(IPP_OPERATION_NOT_SUPPORTED
, httpStatus(status
), 0);
1031 case HTTP_NOT_SUPPORTED
:
1032 _cupsSetError(IPP_VERSION_NOT_SUPPORTED
, httpStatus(status
), 0);
1035 case HTTP_UPGRADE_REQUIRED
:
1036 _cupsSetError(IPP_UPGRADE_REQUIRED
, httpStatus(status
), 0);
1039 case HTTP_PKI_ERROR
:
1040 _cupsSetError(IPP_PKI_ERROR
, httpStatus(status
), 0);
1044 _cupsSetError(IPP_INTERNAL_ERROR
, httpStatus(status
), 0);
1048 DEBUG_printf(("4_cupsSetHTTPError: HTTP error %d mapped to "
1049 "IPP_SERVICE_UNAVAILABLE!", status
));
1050 _cupsSetError(IPP_SERVICE_UNAVAILABLE
, httpStatus(status
), 0);
1057 * End of "$Id: request.c 7946 2008-09-16 23:27:54Z mike $".