| 9883 | */ |
| 9884 | |
| 9885 | static void |
| 9886 | send_document(cupsd_client_t *con, /* I - Client connection */ |
| 9887 | ipp_attribute_t *uri) /* I - Printer URI */ |
| 9888 | { |
| 9889 | ipp_attribute_t *attr; /* Current attribute */ |
| 9890 | ipp_attribute_t *format; /* Request's document-format attribute */ |
| 9891 | ipp_attribute_t *jformat; /* Job's document-format attribute */ |
| 9892 | const char *default_format;/* document-format-default value */ |
| 9893 | int jobid; /* Job ID number */ |
| 9894 | cupsd_job_t *job; /* Current job */ |
| 9895 | char job_uri[HTTP_MAX_URI], |
| 9896 | /* Job URI */ |
| 9897 | scheme[HTTP_MAX_URI], |
| 9898 | /* Method portion of URI */ |
| 9899 | username[HTTP_MAX_URI], |
| 9900 | /* Username portion of URI */ |
| 9901 | host[HTTP_MAX_URI], |
| 9902 | /* Host portion of URI */ |
| 9903 | resource[HTTP_MAX_URI]; |
| 9904 | /* Resource portion of URI */ |
| 9905 | int port; /* Port portion of URI */ |
| 9906 | mime_type_t *filetype; /* Type of file */ |
| 9907 | char super[MIME_MAX_SUPER], |
| 9908 | /* Supertype of file */ |
| 9909 | type[MIME_MAX_TYPE], |
| 9910 | /* Subtype of file */ |
| 9911 | mimetype[MIME_MAX_SUPER + MIME_MAX_TYPE + 2]; |
| 9912 | /* Textual name of mime type */ |
| 9913 | char filename[1024]; /* Job filename */ |
| 9914 | cupsd_printer_t *printer; /* Current printer */ |
| 9915 | struct stat fileinfo; /* File information */ |
| 9916 | int kbytes; /* Size of file */ |
| 9917 | int compression; /* Type of compression */ |
| 9918 | int start_job; /* Start the job? */ |
| 9919 | |
| 9920 | |
| 9921 | cupsdLogMessage(CUPSD_LOG_DEBUG2, "send_document(%p[%d], %s)", (void *)con, |
| 9922 | con->number, uri->values[0].string.text); |
| 9923 | |
| 9924 | /* |
| 9925 | * See if we have a job URI or a printer URI... |
| 9926 | */ |
| 9927 | |
| 9928 | if (!strcmp(uri->name, "printer-uri")) |
| 9929 | { |
| 9930 | /* |
| 9931 | * Got a printer URI; see if we also have a job-id attribute... |
| 9932 | */ |
| 9933 | |
| 9934 | if ((attr = ippFindAttribute(con->request, "job-id", |
| 9935 | IPP_TAG_INTEGER)) == NULL) |
| 9936 | { |
| 9937 | send_ipp_status(con, IPP_BAD_REQUEST, |
| 9938 | _("Got a printer-uri attribute but no job-id.")); |
| 9939 | return; |
| 9940 | } |
| 9941 | |
| 9942 | jobid = attr->values[0].integer; |
no test coverage detected