]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
mimeGetFilterTypes didn't try to find filters to the printer format before
authorMichael R Sweet <msweet@msweet.org>
Sun, 16 Nov 2025 13:59:31 +0000 (08:59 -0500)
committerMichael R Sweet <msweet@msweet.org>
Sun, 16 Nov 2025 14:05:51 +0000 (09:05 -0500)
bailing.

Log the attributes returned by the printer when setting up an IPP Everywhere
queue.

Log the printer MIME media type.

scheduler/filter.c
scheduler/ipp.c
scheduler/printers.c

index a766683d829d72f267aeef8758356f0e20e8d697..b00680006fe8c5e3a5bc9539febac4fc045634d2 100644 (file)
@@ -614,7 +614,15 @@ mime_get_filter_types(
       src = (mime_type_t *)cupsArrayGetElement(c->srcs, i);
 
       if (!strcmp(src->super, "printer"))
+      {
+       if (level < 4)
+       {
+         // Add filters that can convert to this type...
+         srcs = mime_get_filter_types(mime, src, srcs, level + 1);
+       }
+
         continue;
+      }
 
       if (!cupsArrayFind(srcs, src))
       {
index 44e2512738e866a483d00add7ec8a7f832e8be41..0b016f31e61198fe3488257ba68a6b5ca9327c03 100644 (file)
@@ -5376,6 +5376,8 @@ create_local_bg_thread(
   }
   else
   {
+    ipp_tag_t          group;          /* Current group tag */
+
     cupsdLogPrinter(printer, CUPSD_LOG_ERROR, "PPD creation failed: %s", cupsGetErrorString());
 
     /* Force printer to timeout and be deleted */
@@ -5385,6 +5387,31 @@ create_local_bg_thread(
     cupsRWUnlock(&printer->lock);
 
     send_ipp_status(con, IPP_STATUS_ERROR_DEVICE, _("Unable to create PPD: %s"), cupsGetErrorString());
+
+    cupsdLogClient(con, CUPSD_LOG_DEBUG, "Printer attributes:");
+
+    for (group = IPP_TAG_ZERO, attr = ippFirstAttribute(response); attr; attr = ippNextAttribute(response))
+    {
+      const char  *name;                /* Attribute name */
+      char        value[1024];          /* Attribute value */
+
+      if (group != ippGetGroupTag(attr))
+      {
+        group = ippGetGroupTag(attr);
+        if (group != IPP_TAG_ZERO)
+          cupsdLogClient(con, CUPSD_LOG_DEBUG, "%s", ippTagString(group));
+      }
+
+      if ((name = ippGetName(attr)) == NULL)
+        continue;
+
+      ippAttributeString(attr, value, sizeof(value));
+
+      cupsdLogClient(con, CUPSD_LOG_DEBUG, "%s %s%s '%s'", name, ippGetCount(attr) > 1 ? "1setOf " : "", ippTagString(ippGetValueTag(attr)), value);
+    }
+
+    cupsdLogClient(con, CUPSD_LOG_DEBUG, "end-of-attributes-tag");
+
     goto finish_response;
   }
 
index 7c5090f2b2c6756042d20f3826654e140cfcc3d0..2055b648b255d58c8dbbea7005094a669ee3d79e 100644 (file)
@@ -3550,6 +3550,8 @@ add_printer_formats(cupsd_printer_t *p)   /* I - Printer */
   * Otherwise, get the list of supported source types...
   */
 
+  cupsdLogPrinter(p, CUPSD_LOG_DEBUG2, "add_printer_formats: filetype=%s/%s", p->filetype ? p->filetype->super : "null", p->filetype ? p->filetype->type : "null");
+
   p->filetypes = mimeGetFilterTypes(MimeDatabase, p->filetype, NULL);
 
   if ((type = mimeType(MimeDatabase, "application", "pdf")) != NULL && cupsArrayFind(p->filetypes, type))