]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/request.c
Merge changes from CUPS 1.4svn-r7817.
[thirdparty/cups.git] / cups / request.c
1 /*
2 * "$Id: request.c 7460 2008-04-16 02:19:54Z mike $"
3 *
4 * IPP utilities for the Common UNIX Printing System (CUPS).
5 *
6 * Copyright 2007-2008 by Apple Inc.
7 * Copyright 1997-2007 by Easy Software Products.
8 *
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/".
14 *
15 * This file is subject to the Apple OS-Developed Software exception.
16 *
17 * Contents:
18 *
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 * cupsReadResponseData() - Read additional data after the IPP response.
24 * cupsSendRequest() - Send an IPP request.
25 * cupsWriteRequestData() - Write additional data after an IPP request.
26 * _cupsSetError() - Set the last IPP status code and status-message.
27 * _cupsSetHTTPError() - Set the last error using the HTTP status.
28 */
29
30 /*
31 * Include necessary headers...
32 */
33
34 #include "globals.h"
35 #include "debug.h"
36 #include <stdlib.h>
37 #include <errno.h>
38 #include <fcntl.h>
39 #include <sys/stat.h>
40 #if defined(WIN32) || defined(__EMX__)
41 # include <io.h>
42 #else
43 # include <unistd.h>
44 #endif /* WIN32 || __EMX__ */
45 #ifndef O_BINARY
46 # define O_BINARY 0
47 #endif /* O_BINARY */
48
49
50 /*
51 * 'cupsDoFileRequest()' - Do an IPP request with a file.
52 *
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.
56 */
57
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 */
63 {
64 ipp_t *response; /* IPP response data */
65 int infile; /* Input file */
66
67
68 DEBUG_printf(("cupsDoFileRequest(http=%p, request=%p(%s), resource=\"%s\", "
69 "filename=\"%s\")\n", http, request,
70 request ? ippOpString(request->request.op.operation_id) : "?",
71 resource ? resource : "(null)",
72 filename ? filename : "(null)"));
73
74 if (filename)
75 {
76 if ((infile = open(filename, O_RDONLY | O_BINARY)) < 0)
77 {
78 /*
79 * Can't get file information!
80 */
81
82 _cupsSetError(errno == ENOENT ? IPP_NOT_FOUND : IPP_NOT_AUTHORIZED,
83 NULL, 0);
84
85 ippDelete(request);
86
87 return (NULL);
88 }
89 }
90 else
91 infile = -1;
92
93 response = cupsDoIORequest(http, request, resource, infile, -1);
94
95 if (infile >= 0)
96 close(infile);
97
98 return (response);
99 }
100
101
102 /*
103 * 'cupsDoIORequest()' - Do an IPP request with file descriptors.
104 *
105 * This function sends the IPP request to the specified server, retrying
106 * and authenticating as necessary. The request is freed with ippDelete()
107 * after receiving a valid IPP response.
108 *
109 * If "infile" is a valid file descriptor, cupsDoIORequest() copies
110 * all of the data from the file after the IPP request message.
111 *
112 * If "outfile" is a valid file descriptor, cupsDoIORequest() copies
113 * all of the data after the IPP response message to the file.
114 *
115 * @since CUPS 1.3@
116 */
117
118 ipp_t * /* O - Response data */
119 cupsDoIORequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
120 ipp_t *request, /* I - IPP request */
121 const char *resource, /* I - HTTP resource for POST */
122 int infile, /* I - File to read from or -1 for none */
123 int outfile) /* I - File to write to or -1 for none */
124 {
125 ipp_t *response = NULL; /* IPP response data */
126 size_t length = 0; /* Content-Length value */
127 http_status_t status; /* Status of HTTP request */
128 struct stat fileinfo; /* File information */
129 int bytes; /* Number of bytes read/written */
130 char buffer[32768]; /* Output buffer */
131
132
133 DEBUG_printf(("cupsDoIORequest(http=%p, request=%p(%s), resource=\"%s\", "
134 "infile=%d, outfile=%d)\n", http, request,
135 request ? ippOpString(request->request.op.operation_id) : "?",
136 resource ? resource : "(null)", infile, outfile));
137
138 /*
139 * Range check input...
140 */
141
142 if (!request || !resource)
143 {
144 ippDelete(request);
145
146 _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
147
148 return (NULL);
149 }
150
151 /*
152 * Get the default connection as needed...
153 */
154
155 if (!http)
156 if ((http = _cupsConnect()) == NULL)
157 return (NULL);
158
159 /*
160 * See if we have a file to send...
161 */
162
163 if (infile >= 0)
164 {
165 if (fstat(infile, &fileinfo))
166 {
167 /*
168 * Can't get file information!
169 */
170
171 _cupsSetError(errno == EBADF ? IPP_NOT_FOUND : IPP_NOT_AUTHORIZED,
172 NULL, 0);
173
174 ippDelete(request);
175
176 return (NULL);
177 }
178
179 #ifdef WIN32
180 if (fileinfo.st_mode & _S_IFDIR)
181 #else
182 if (S_ISDIR(fileinfo.st_mode))
183 #endif /* WIN32 */
184 {
185 /*
186 * Can't send a directory...
187 */
188
189 ippDelete(request);
190
191 _cupsSetError(IPP_NOT_POSSIBLE, strerror(EISDIR), 0);
192
193 return (NULL);
194 }
195
196 #ifndef WIN32
197 if (!S_ISREG(fileinfo.st_mode))
198 length = 0; /* Chunk when piping */
199 else
200 #endif /* !WIN32 */
201 length = ippLength(request) + fileinfo.st_size;
202 }
203 else
204 length = ippLength(request);
205
206 /*
207 * Loop until we can send the request without authorization problems.
208 */
209
210 while (response == NULL)
211 {
212 DEBUG_puts("cupsDoFileRequest: setup...");
213
214 /*
215 * Send the request...
216 */
217
218 status = cupsSendRequest(http, request, resource, length);
219
220 DEBUG_printf(("cupsDoFileRequest: status=%d\n", status));
221
222 if (status == HTTP_CONTINUE && request->state == IPP_DATA && infile >= 0)
223 {
224 DEBUG_puts("cupsDoFileRequest: file write...");
225
226 /*
227 * Send the file with the request...
228 */
229
230 #ifndef WIN32
231 if (S_ISREG(fileinfo.st_mode))
232 #endif /* WIN32 */
233 lseek(infile, 0, SEEK_SET);
234
235 while ((bytes = (int)read(infile, buffer, sizeof(buffer))) > 0)
236 {
237 if (httpCheck(http))
238 {
239 if ((status = httpUpdate(http)) != HTTP_CONTINUE)
240 break;
241 }
242
243 if (httpWrite2(http, buffer, bytes) < bytes)
244 break;
245 }
246 }
247
248 /*
249 * Get the server's response...
250 */
251
252 if (status == HTTP_CONTINUE || status == HTTP_OK)
253 {
254 response = cupsGetResponse(http, resource);
255 status = http->status;
256 }
257
258 if (status == HTTP_FORBIDDEN)
259 break;
260
261 if (response)
262 {
263 if (outfile >= 0)
264 {
265 /*
266 * Write trailing data to file...
267 */
268
269 while ((bytes = (int)httpRead2(http, buffer, sizeof(buffer))) > 0)
270 if (write(outfile, buffer, bytes) < bytes)
271 break;
272 }
273 else
274 {
275 /*
276 * Flush any remaining data...
277 */
278
279 httpFlush(http);
280 }
281 }
282 }
283
284 /*
285 * Delete the original request and return the response...
286 */
287
288 ippDelete(request);
289
290 return (response);
291 }
292
293
294 /*
295 * 'cupsDoRequest()' - Do an IPP request.
296 *
297 * This function sends the IPP request to the specified server, retrying
298 * and authenticating as necessary. The request is freed with ippDelete()
299 * after receiving a valid IPP response.
300 */
301
302 ipp_t * /* O - Response data */
303 cupsDoRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
304 ipp_t *request, /* I - IPP request */
305 const char *resource) /* I - HTTP resource for POST */
306 {
307 DEBUG_printf(("cupsDoRequest(http=%p, request=%p(%s), resource=\"%s\")\n",
308 http, request,
309 request ? ippOpString(request->request.op.operation_id) : "?",
310 resource ? resource : "(null)"));
311
312 return (cupsDoFileRequest(http, request, resource, NULL));
313 }
314
315
316 /*
317 * 'cupsGetResponse()' - Get a response to an IPP request.
318 *
319 * Use this function to get the response for an IPP request sent using
320 * cupsSendDocument() or cupsSendRequest(). For requests that return
321 * additional data, use httpRead() after getting a successful response.
322 *
323 * @since CUPS 1.4@
324 */
325
326 ipp_t * /* O - Response or @code NULL@ on HTTP error */
327 cupsGetResponse(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
328 const char *resource) /* I - HTTP resource for POST */
329 {
330 http_status_t status; /* HTTP status */
331 ipp_state_t state; /* IPP read state */
332 ipp_t *response = NULL; /* IPP response */
333
334
335 DEBUG_printf(("cupsGetReponse(http=%p, resource=\"%s\")\n", http,
336 resource ? resource : "(null)"));
337
338 /*
339 * Connect to the default server as needed...
340 */
341
342 if (!http)
343 http = _cupsConnect();
344
345 if (!http || (http->state != HTTP_POST_RECV && http->state != HTTP_POST_SEND))
346 return (NULL);
347
348 /*
349 * Check for an unfinished chunked request...
350 */
351
352 if (http->data_encoding == HTTP_ENCODE_CHUNKED)
353 {
354 /*
355 * Send a 0-length chunk to finish off the request...
356 */
357
358 DEBUG_puts("cupsGetResponse: Finishing chunked POST...");
359
360 if (httpWrite2(http, "", 0) < 0)
361 return (NULL);
362 }
363
364 /*
365 * Wait for a response from the server...
366 */
367
368 DEBUG_puts("cupsGetResponse: Update loop...");
369
370 while ((status = httpUpdate(http)) == HTTP_CONTINUE)
371 /* Do nothing but update */;
372
373 DEBUG_printf(("cupsGetResponse: status=%d\n", status));
374
375 if (status == HTTP_OK)
376 {
377 /*
378 * Get the IPP response...
379 */
380
381 response = ippNew();
382
383 while ((state = ippRead(http, response)) != IPP_DATA)
384 if (state == IPP_ERROR)
385 break;
386
387 if (state == IPP_ERROR)
388 {
389 /*
390 * Delete the response...
391 */
392
393 DEBUG_puts("cupsGetResponse: IPP read error!");
394
395 ippDelete(response);
396 response = NULL;
397
398 _cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
399 }
400 }
401 else if (status != HTTP_ERROR)
402 {
403 /*
404 * Flush any error message...
405 */
406
407 httpFlush(http);
408
409 /*
410 * Then handle encryption and authentication...
411 */
412
413 if (status == HTTP_UNAUTHORIZED)
414 {
415 /*
416 * See if we can do authentication...
417 */
418
419 int auth_result;
420
421 DEBUG_puts("cupsGetResponse: Need authorization...");
422
423 if ((auth_result = cupsDoAuthentication(http, "POST", resource)) == 0)
424 httpReconnect(http);
425 else if (auth_result < 0)
426 http->status = status = HTTP_FORBIDDEN;
427 }
428
429 #ifdef HAVE_SSL
430 else if (status == HTTP_UPGRADE_REQUIRED)
431 {
432 /*
433 * Force a reconnect with encryption...
434 */
435
436 DEBUG_puts("cupsGetResponse: Need encryption...");
437
438 if (!httpReconnect(http))
439 httpEncryption(http, HTTP_ENCRYPT_REQUIRED);
440 }
441 #endif /* HAVE_SSL */
442 }
443
444 if (response)
445 {
446 ipp_attribute_t *attr; /* status-message attribute */
447
448
449 attr = ippFindAttribute(response, "status-message", IPP_TAG_TEXT);
450
451 DEBUG_printf(("cupsGetResponse: status-code=%s, status-message=\"%s\"\n",
452 ippErrorString(response->request.status.status_code),
453 attr ? attr->values[0].string.text : ""));
454
455 _cupsSetError(response->request.status.status_code,
456 attr ? attr->values[0].string.text :
457 ippErrorString(response->request.status.status_code), 0);
458 }
459 else if (status != HTTP_OK)
460 _cupsSetHTTPError(status);
461
462 return (response);
463 }
464
465
466 /*
467 * 'cupsReadResponseData()' - Read additional data after the IPP response.
468 *
469 * This function is used after cupsGetResponse() to read the PPD or document
470 * files for CUPS_GET_PPD and CUPS_GET_DOCUMENT requests, respectively.
471 *
472 * @since CUPS 1.4@
473 */
474
475 ssize_t /* O - Bytes read, 0 on EOF, -1 on error */
476 cupsReadResponseData(
477 http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
478 char *buffer, /* I - Buffer to use */
479 size_t length) /* I - Number of bytes to read */
480 {
481 /*
482 * Get the default connection as needed...
483 */
484
485 DEBUG_printf(("cupsReadResponseData(http=%p, buffer=%p, "
486 "length=" CUPS_LLFMT ")\n", http, buffer, CUPS_LLCAST length));
487
488 if (!http)
489 {
490 _cups_globals_t *cg = _cupsGlobals();
491 /* Pointer to library globals */
492
493 if ((http = cg->http) == NULL)
494 {
495 _cupsSetError(IPP_INTERNAL_ERROR, _("No active connection"), 1);
496 return (-1);
497 }
498 }
499
500 /*
501 * Then read from the HTTP connection...
502 */
503
504 return (httpRead2(http, buffer, length));
505 }
506
507
508 /*
509 * 'cupsSendRequest()' - Send an IPP request.
510 *
511 * Use httpWrite() to write any additional data (document, PPD file, etc.)
512 * for the request, cupsGetResponse() to get the IPP response, and httpRead()
513 * to read any additional data following the response. Only one request can be
514 * sent/queued at a time.
515 *
516 * Unlike cupsDoFileRequest(), cupsDoIORequest(), and cupsDoRequest(), the
517 * request is not freed.
518 *
519 * @since CUPS 1.4@
520 */
521
522 http_status_t /* O - Initial HTTP status */
523 cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
524 ipp_t *request, /* I - IPP request */
525 const char *resource, /* I - Resource path */
526 size_t length) /* I - Length of data to follow or @code CUPS_LENGTH_VARIABLE@ */
527 {
528 http_status_t status; /* Status of HTTP request */
529 int got_status; /* Did we get the status? */
530 ipp_state_t state; /* State of IPP processing */
531 http_status_t expect; /* Expect: header to use */
532
533
534 DEBUG_printf(("cupsSendRequest(http=%p, request=%p(%s), resource=\"%s\", "
535 "length=" CUPS_LLFMT ")\n", http, request,
536 request ? ippOpString(request->request.op.operation_id) : "?",
537 resource ? resource : "(null)", CUPS_LLCAST length));
538
539 /*
540 * Range check input...
541 */
542
543 if (!request || !resource)
544 {
545 _cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
546
547 return (HTTP_ERROR);
548 }
549
550 /*
551 * Get the default connection as needed...
552 */
553
554 if (!http)
555 if ((http = _cupsConnect()) == NULL)
556 return (HTTP_SERVICE_UNAVAILABLE);
557
558 #ifdef HAVE_SSL
559 /*
560 * See if we have an auth-info attribute and are communicating over
561 * a non-local link. If so, encrypt the link so that we can pass
562 * the authentication information securely...
563 */
564
565 if (ippFindAttribute(request, "auth-info", IPP_TAG_TEXT) &&
566 !httpAddrLocalhost(http->hostaddr) && !http->tls &&
567 httpEncryption(http, HTTP_ENCRYPT_REQUIRED))
568 return (HTTP_ERROR);
569 #endif /* HAVE_SSL */
570
571 /*
572 * Loop until we can send the request without authorization problems.
573 */
574
575 expect = HTTP_CONTINUE;
576
577 for (;;)
578 {
579 DEBUG_puts("cupsSendRequest: Setup...");
580
581 /*
582 * Setup the HTTP variables needed...
583 */
584
585 httpClearFields(http);
586 httpSetLength(http, length);
587 httpSetField(http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
588 httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
589 httpSetExpect(http, expect);
590
591 DEBUG_printf(("cupsSendRequest: authstring=\"%s\"\n", http->authstring));
592
593 /*
594 * Try the request...
595 */
596
597 DEBUG_puts("cupsSendRequest: Sending HTTP POST...");
598
599 if (httpPost(http, resource))
600 {
601 if (httpReconnect(http))
602 return (HTTP_ERROR);
603 else
604 continue;
605 }
606
607 /*
608 * Send the IPP data...
609 */
610
611 DEBUG_puts("cupsSendRequest: Writing IPP request...");
612
613 request->state = IPP_IDLE;
614 status = HTTP_CONTINUE;
615 got_status = 0;
616
617 while ((state = ippWrite(http, request)) != IPP_DATA)
618 if (state == IPP_ERROR)
619 break;
620 else if (httpCheck(http))
621 {
622 got_status = 1;
623
624 if ((status = httpUpdate(http)) != HTTP_CONTINUE)
625 break;
626 }
627
628 /*
629 * Wait up to 1 second to get the 100-continue response as needed...
630 */
631
632 if (!got_status && expect == HTTP_CONTINUE)
633 {
634 DEBUG_puts("cupsSendRequest: Waiting for 100-continue...");
635
636 if (httpWait(http, 1000))
637 status = httpUpdate(http);
638 else
639 status = HTTP_EXPECTATION_FAILED;
640 }
641 else if (httpCheck(http))
642 status = httpUpdate(http);
643
644 DEBUG_printf(("cupsSendRequest: status=%d\n", status));
645
646 /*
647 * Process the current HTTP status...
648 */
649
650 switch (status)
651 {
652 case HTTP_ERROR :
653 case HTTP_CONTINUE :
654 case HTTP_OK :
655 return (status);
656
657 case HTTP_UNAUTHORIZED :
658 if (!cupsDoAuthentication(http, "POST", resource))
659 if (httpReconnect(http))
660 return (HTTP_ERROR);
661
662 return (status);
663
664 #ifdef HAVE_SSL
665 case HTTP_UPGRADE_REQUIRED :
666 /*
667 * Flush any error message, reconnect, and then upgrade with
668 * encryption...
669 */
670
671 if (httpReconnect(http))
672 return (HTTP_ERROR);
673
674 httpEncryption(http, HTTP_ENCRYPT_REQUIRED);
675
676 return (status);
677 #endif /* HAVE_SSL */
678
679 case HTTP_EXPECTATION_FAILED :
680 /*
681 * Don't try using the Expect: header the next time around...
682 */
683
684 expect = (http_status_t)0;
685 break;
686
687 default :
688 /*
689 * Some other error...
690 */
691
692 return (status);
693 }
694 }
695 }
696
697
698 /*
699 * 'cupsWriteRequestData()' - Write additional data after an IPP request.
700 *
701 * This function is used after @link cupsSendRequest@ to provide a PPD and
702 * after @link cupsStartDocument@ to provide a document file.
703 *
704 * @since CUPS 1.4@
705 */
706
707 http_status_t /* O - @code HTTP_CONTINUE@ if OK or HTTP status on error */
708 cupsWriteRequestData(
709 http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
710 const char *buffer, /* I - Bytes to write */
711 size_t length) /* I - Number of bytes to write */
712 {
713 /*
714 * Get the default connection as needed...
715 */
716
717 DEBUG_printf(("cupsWriteRequestData(http=%p, buffer=%p, "
718 "length=" CUPS_LLFMT ")\n", http, buffer, CUPS_LLCAST length));
719
720 if (!http)
721 {
722 _cups_globals_t *cg = _cupsGlobals();
723 /* Pointer to library globals */
724
725 if ((http = cg->http) == NULL)
726 {
727 _cupsSetError(IPP_INTERNAL_ERROR, _("No active connection"), 1);
728 return (HTTP_ERROR);
729 }
730 }
731
732 /*
733 * Then write to the HTTP connection...
734 */
735
736 if (httpWrite2(http, buffer, length) < 0)
737 return (HTTP_ERROR);
738
739 /*
740 * Finally, check if we have any pending data from the server...
741 */
742
743 if (httpCheck(http))
744 return (httpUpdate(http));
745 else
746 return (HTTP_CONTINUE);
747 }
748
749
750 /*
751 * '_cupsSetError()' - Set the last IPP status code and status-message.
752 */
753
754 void
755 _cupsSetError(ipp_status_t status, /* I - IPP status code */
756 const char *message, /* I - status-message value */
757 int localize) /* I - Localize the message? */
758 {
759 _cups_globals_t *cg; /* Global data */
760
761
762 if (!message && errno)
763 {
764 message = strerror(errno);
765 localize = 0;
766 }
767
768 cg = _cupsGlobals();
769 cg->last_error = status;
770
771 if (cg->last_status_message)
772 {
773 _cupsStrFree(cg->last_status_message);
774
775 cg->last_status_message = NULL;
776 }
777
778 if (message)
779 {
780 if (localize)
781 {
782 /*
783 * Get the message catalog...
784 */
785
786 if (!cg->lang_default)
787 cg->lang_default = cupsLangDefault();
788
789 cg->last_status_message = _cupsStrAlloc(_cupsLangString(cg->lang_default,
790 message));
791 }
792 else
793 cg->last_status_message = _cupsStrAlloc(message);
794 }
795
796 DEBUG_printf(("_cupsSetError: last_error=%s, last_status_message=\"%s\"\n",
797 ippErrorString(cg->last_error),
798 cg->last_status_message ? cg->last_status_message : ""));
799 }
800
801
802 /*
803 * '_cupsSetHTTPError()' - Set the last error using the HTTP status.
804 */
805
806 void
807 _cupsSetHTTPError(http_status_t status) /* I - HTTP status code */
808 {
809 switch (status)
810 {
811 case HTTP_NOT_FOUND :
812 _cupsSetError(IPP_NOT_FOUND, httpStatus(status), 0);
813 break;
814
815 case HTTP_UNAUTHORIZED :
816 _cupsSetError(IPP_NOT_AUTHORIZED, httpStatus(status), 0);
817 break;
818
819 case HTTP_FORBIDDEN :
820 _cupsSetError(IPP_FORBIDDEN, httpStatus(status), 0);
821 break;
822
823 case HTTP_BAD_REQUEST :
824 _cupsSetError(IPP_BAD_REQUEST, httpStatus(status), 0);
825 break;
826
827 case HTTP_REQUEST_TOO_LARGE :
828 _cupsSetError(IPP_REQUEST_VALUE, httpStatus(status), 0);
829 break;
830
831 case HTTP_NOT_IMPLEMENTED :
832 _cupsSetError(IPP_OPERATION_NOT_SUPPORTED, httpStatus(status), 0);
833 break;
834
835 case HTTP_NOT_SUPPORTED :
836 _cupsSetError(IPP_VERSION_NOT_SUPPORTED, httpStatus(status), 0);
837 break;
838
839 default :
840 DEBUG_printf(("HTTP error %d mapped to IPP_SERVICE_UNAVAILABLE!\n",
841 status));
842 _cupsSetError(IPP_SERVICE_UNAVAILABLE, httpStatus(status), 0);
843 break;
844 }
845 }
846
847
848 /*
849 * End of "$Id: request.c 7460 2008-04-16 02:19:54Z mike $".
850 */