diff options
author | Michael R Sweet <michael.r.sweet@gmail.com> | 2018-06-13 14:32:16 -0400 |
---|---|---|
committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2018-06-13 14:32:16 -0400 |
commit | ef97be3b01c59f81c94891c2a07e399212512f67 (patch) | |
tree | 4cf022dfe4456ecc542f9e752977d7905dc26c83 /backend | |
parent | c3a9caacd99d1a445946b53f0a5b6c17d5782177 (diff) | |
download | cups-ef97be3b01c59f81c94891c2a07e399212512f67.tar.gz |
Turn off duplex if validate-job says it can't be done.
Diffstat (limited to 'backend')
-rw-r--r-- | backend/ipp.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/backend/ipp.c b/backend/ipp.c index aa9d09a9f..a0c386540 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -1485,6 +1485,30 @@ main(int argc, /* I - Number of command-line args */ ippGetString(job_auth, 0, NULL), num_options, &options); + if (ipp_status == IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED || ipp_status == IPP_STATUS_OK_CONFLICTING) + { + /* + * One or more options are not supported... + */ + + ipp_attribute_t *attr; /* Unsupported attribute */ + + if ((attr = ippFindAttribute(response, "sides", IPP_TAG_ZERO)) != NULL) + { + /* + * The sides value is not supported, revert to one-sided as needed... + */ + + const char *sides = cupsGetOption("sides", num_options, options); + + if (!strncmp(sides, "two-sided-", 10)) + { + fputs("DEBUG: Unable to do two-sided printing, setting sides to 'one-sided'.\n", stderr); + num_options = cupsAddOption("sides", "one-sided", num_options, &options); + } + } + } + ippDelete(response); if (job_canceled) |