diff options
Diffstat (limited to 'systemv/lp.c')
-rw-r--r-- | systemv/lp.c | 43 |
1 files changed, 38 insertions, 5 deletions
diff --git a/systemv/lp.c b/systemv/lp.c index 99bf333f..24ee4137 100644 --- a/systemv/lp.c +++ b/systemv/lp.c @@ -1,5 +1,5 @@ /* - * "$Id: lp.c 10829 2013-01-21 13:12:23Z mike $" + * "$Id: lp.c 11101 2013-07-08 11:20:33Z msweet $" * * "lp" command for CUPS. * @@ -146,7 +146,8 @@ main(int argc, /* I - Number of command-line arguments */ if ((instance = strrchr(printer, '/')) != NULL) *instance++ = '\0'; - if ((dest = cupsGetNamedDest(NULL, printer, instance)) != NULL) + if ((dest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, printer, + instance)) != NULL) { for (j = 0; j < dest->num_options; j ++) if (cupsGetOption(dest->options[j].name, num_options, @@ -155,6 +156,14 @@ main(int argc, /* I - Number of command-line arguments */ dest->options[j].value, num_options, &options); } + else if (cupsLastError() == IPP_STATUS_ERROR_BAD_REQUEST || + cupsLastError() == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED) + { + _cupsLangPrintf(stderr, + _("%s: Error - add '/version=1.1' to server " + "name."), argv[0]); + return (1); + } break; case 'f' : /* Form */ @@ -567,6 +576,14 @@ main(int argc, /* I - Number of command-line arguments */ dest->options[j].value, num_options, &options); } + else if (cupsLastError() == IPP_STATUS_ERROR_BAD_REQUEST || + cupsLastError() == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED) + { + _cupsLangPrintf(stderr, + _("%s: Error - add '/version=1.1' to server " + "name."), argv[0]); + return (1); + } } if (printer == NULL) @@ -679,7 +696,15 @@ restart_job(const char *command, /* I - Command name */ ippDelete(cupsDoRequest(CUPS_HTTP_DEFAULT, request, "/jobs")); - if (cupsLastError() > IPP_OK_CONFLICT) + if (cupsLastError() == IPP_STATUS_ERROR_BAD_REQUEST || + cupsLastError() == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED) + { + _cupsLangPrintf(stderr, + _("%s: Error - add '/version=1.1' to server " + "name."), command); + return (1); + } + else if (cupsLastError() > IPP_OK_CONFLICT) { _cupsLangPrintf(stderr, "%s: %s", command, cupsLastErrorString()); return (1); @@ -720,7 +745,15 @@ set_job_attrs(const char *command, /* I - Command name */ ippDelete(cupsDoRequest(CUPS_HTTP_DEFAULT, request, "/jobs")); - if (cupsLastError() > IPP_OK_CONFLICT) + if (cupsLastError() == IPP_STATUS_ERROR_BAD_REQUEST || + cupsLastError() == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED) + { + _cupsLangPrintf(stderr, + _("%s: Error - add '/version=1.1' to server " + "name."), command); + return (1); + } + else if (cupsLastError() > IPP_OK_CONFLICT) { _cupsLangPrintf(stderr, "%s: %s", command, cupsLastErrorString()); return (1); @@ -731,5 +764,5 @@ set_job_attrs(const char *command, /* I - Command name */ /* - * End of "$Id: lp.c 10829 2013-01-21 13:12:23Z mike $". + * End of "$Id: lp.c 11101 2013-07-08 11:20:33Z msweet $". */ |