]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - systemv/lpadmin.c
Move debug printfs to internal usage only.
[thirdparty/cups.git] / systemv / lpadmin.c
index bd4eb0164a6698b9f00c64f6cb130f9f7b818e6b..3e2e1ff0edd682ed8716baab71c20837ce637cf6 100644 (file)
@@ -704,9 +704,6 @@ add_printer_to_class(http_t *http,  /* I - Server connection */
   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:
@@ -825,8 +822,6 @@ default_printer(http_t *http,               /* I - Server connection */
   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:
@@ -876,8 +871,6 @@ delete_printer(http_t *http,                /* I - Server connection */
   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:
@@ -932,9 +925,6 @@ delete_printer_from_class(
   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:
@@ -1132,8 +1122,6 @@ enable_printer(http_t *http,              /* I - Server connection */
   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:
@@ -1248,7 +1236,12 @@ get_printer_ppd(
   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);
@@ -1365,10 +1358,6 @@ set_printer_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: