char uri[HTTP_MAX_URI]; /* URI for printer/class */
- DEBUG_printf(("add_printer_to_class(%p, \"%s\", \"%s\")\n", http,
- printer, pclass));
-
/*
* Build an IPP_OP_GET_PRINTER_ATTRIBUTES request, which requires the following
* attributes:
char uri[HTTP_MAX_URI]; /* URI for printer/class */
- DEBUG_printf(("default_printer(%p, \"%s\")\n", http, printer));
-
/*
* Build a CUPS-Set-Default request, which requires the following
* attributes:
char uri[HTTP_MAX_URI]; /* URI for printer/class */
- DEBUG_printf(("delete_printer(%p, \"%s\")\n", http, printer));
-
/*
* Build a CUPS-Delete-Printer request, which requires the following
* attributes:
char uri[HTTP_MAX_URI]; /* URI for printer/class */
- DEBUG_printf(("delete_printer_from_class(%p, \"%s\", \"%s\")\n", http,
- printer, pclass));
-
/*
* Build an IPP_OP_GET_PRINTER_ATTRIBUTES request, which requires the following
* attributes:
char uri[HTTP_MAX_URI]; /* URI for printer/class */
- DEBUG_printf(("enable_printer(%p, \"%s\")\n", http, printer));
-
/*
* Send IPP_OP_ENABLE_PRINTER and IPP_OP_RESUME_PRINTER requests, which
* require the following attributes:
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", sizeof(pattrs) / sizeof(pattrs[0]), NULL, pattrs);
response = cupsDoRequest(http, request, resource);
- if (_ppdCreateFromIPP(buffer, bufsize, response))
+ if (cupsLastError() >= IPP_STATUS_REDIRECTION_OTHER_SITE)
+ {
+ _cupsLangPrintf(stderr, _("%s: Unable to query printer: %s"), "lpadmin", cupsLastErrorString());
+ buffer[0] = '\0';
+ }
+ else if (_ppdCreateFromIPP(buffer, bufsize, response))
{
if (!cupsGetOption("printer-geo-location", *num_options, *options) && (attr = ippFindAttribute(response, "printer-geo-location", IPP_TAG_URI)) != NULL)
*num_options = cupsAddOption("printer-geo-location", ippGetString(attr, 0, NULL), *num_options, options);
copied_options = 0; /* Copied options? */
- DEBUG_printf(("set_printer_options(http=%p, printer=\"%s\", num_options=%d, "
- "options=%p, file=\"%s\")\n", http, printer, num_options,
- options, file));
-
/*
* Build a CUPS-Add-Modify-Printer or CUPS-Add-Modify-Class request,
* which requires the following attributes: