diff options
Diffstat (limited to 'backend/ipp.c')
-rw-r--r-- | backend/ipp.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/backend/ipp.c b/backend/ipp.c index be5fce37c..23dab618f 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -1,5 +1,5 @@ /* - * "$Id: ipp.c 9808 2011-05-26 12:03:28Z mike $" + * "$Id: ipp.c 10112 2011-11-07 06:08:44Z mike $" * * IPP backend for CUPS. * @@ -111,7 +111,7 @@ static const char * const pattrs[] = /* Printer attributes we want */ "printer-is-accepting-jobs", "printer-state", "printer-state-message", - "printer-state-reasons", + "printer-state-reasons" }; static const char * const remote_job_states[] = { /* Remote job state keywords */ @@ -1340,7 +1340,8 @@ main(int argc, /* I - Number of command-line args */ http_status = cupsWriteRequestData(http, buffer, bytes); } - while (http_status == HTTP_CONTINUE) + while (http_status == HTTP_CONTINUE && + (!job_canceled || compatsize > 0)) { /* * Check for side-channel requests and more print data... @@ -1392,6 +1393,7 @@ main(int argc, /* I - Number of command-line args */ break; if (ipp_status == IPP_SERVICE_UNAVAILABLE || + ipp_status == IPP_NOT_POSSIBLE || ipp_status == IPP_PRINTER_BUSY) { _cupsLangPrintFilter(stderr, "INFO", _("The printer is busy.")); @@ -1407,6 +1409,8 @@ main(int argc, /* I - Number of command-line args */ goto cleanup; } } + else if (ipp_status == IPP_ERROR_JOB_CANCELED) + goto cleanup; else { /* @@ -1506,7 +1510,8 @@ main(int argc, /* I - Number of command-line args */ if (http_status == HTTP_CONTINUE && request->state == IPP_DATA && (fd = open(files[i], O_RDONLY)) >= 0) { - while ((bytes = read(fd, buffer, sizeof(buffer))) > 0) + while (!job_canceled && + (bytes = read(fd, buffer, sizeof(buffer))) > 0) { if (cupsWriteRequestData(http, buffer, bytes) != HTTP_CONTINUE) break; @@ -1546,6 +1551,7 @@ main(int argc, /* I - Number of command-line args */ copies_remaining --; } else if (ipp_status == IPP_SERVICE_UNAVAILABLE || + ipp_status == IPP_NOT_POSSIBLE || ipp_status == IPP_PRINTER_BUSY) continue; else @@ -1618,6 +1624,7 @@ main(int argc, /* I - Number of command-line args */ if (ipp_status > IPP_OK_CONFLICT) { if (ipp_status != IPP_SERVICE_UNAVAILABLE && + ipp_status != IPP_NOT_POSSIBLE && ipp_status != IPP_PRINTER_BUSY) { ippDelete(response); @@ -1665,7 +1672,9 @@ main(int argc, /* I - Number of command-line args */ break; } } - else + else if (ipp_status != IPP_SERVICE_UNAVAILABLE && + ipp_status != IPP_NOT_POSSIBLE && + ipp_status != IPP_PRINTER_BUSY) { /* * If the printer does not return a job-state attribute, it does not @@ -1768,7 +1777,7 @@ main(int argc, /* I - Number of command-line args */ else if (ipp_status == IPP_DOCUMENT_FORMAT || ipp_status == IPP_CONFLICT) return (CUPS_BACKEND_FAILED); - else if (ipp_status > IPP_OK_CONFLICT) + else if (ipp_status > IPP_OK_CONFLICT && ipp_status != IPP_ERROR_JOB_CANCELED) return (CUPS_BACKEND_RETRY_CURRENT); else { @@ -2192,15 +2201,15 @@ new_request( else if (!strcmp(media_col_sup->values[i].string.text, "media-bottom-margin")) ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER, - "media-bottom-margin", size->left); + "media-bottom-margin", size->bottom); else if (!strcmp(media_col_sup->values[i].string.text, "media-right-margin")) ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER, - "media-right-margin", size->left); + "media-right-margin", size->right); else if (!strcmp(media_col_sup->values[i].string.text, "media-top-margin")) ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER, - "media-top-margin", size->left); + "media-top-margin", size->top); else if (!strcmp(media_col_sup->values[i].string.text, "media-source") && media_source) ippAddString(media_col, IPP_TAG_ZERO, IPP_TAG_KEYWORD, @@ -2822,6 +2831,7 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */ if (strcmp(reason, "none") && strcmp(reason, "none-report") && strcmp(reason, "paused") && + strncmp(reason, "spool-area-full", 15) && strcmp(reason, "com.apple.print.recoverable-warning") && strncmp(reason, "cups-", 5)) cupsArrayAdd(new_reasons, reason); @@ -2978,5 +2988,5 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */ } /* - * End of "$Id: ipp.c 9808 2011-05-26 12:03:28Z mike $". + * End of "$Id: ipp.c 10112 2011-11-07 06:08:44Z mike $". */ |