From: Michael R Sweet Date: Wed, 13 Jun 2018 18:32:16 +0000 (-0400) Subject: Turn off duplex if validate-job says it can't be done. X-Git-Tag: v2.3b6~146 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef97be3b01c59f81c94891c2a07e399212512f67;p=thirdparty%2Fcups.git Turn off duplex if validate-job says it can't be done. --- diff --git a/backend/ipp.c b/backend/ipp.c index aa9d09a9fb..a0c386540d 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)