diff options
author | Didier Raboud <odyx@debian.org> | 2014-01-02 23:03:44 +0100 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2014-01-02 23:03:44 +0100 |
commit | d13746555c30d1d1bd617dcf64d5b92e319ae2b5 (patch) | |
tree | ba335eb874926e0d4efebaccb46f2d5d390c7854 /systemv/lp.c | |
parent | 11884b3954f87fa67f02dca9169df32666b5363c (diff) | |
download | cups-d13746555c30d1d1bd617dcf64d5b92e319ae2b5.tar.gz |
Imported Upstream version 1.7.0~rc1upstream/1.7.0_rc1
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 $". */ |