From: Michael R Sweet Date: Sun, 16 Nov 2025 13:59:31 +0000 (-0500) Subject: mimeGetFilterTypes didn't try to find filters to the printer format before X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae5f04bb2390872cc70470d415dee017785a0dae;p=thirdparty%2Fcups.git mimeGetFilterTypes didn't try to find filters to the printer format before bailing. Log the attributes returned by the printer when setting up an IPP Everywhere queue. Log the printer MIME media type. --- diff --git a/scheduler/filter.c b/scheduler/filter.c index a766683d82..b00680006f 100644 --- a/scheduler/filter.c +++ b/scheduler/filter.c @@ -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)) { diff --git a/scheduler/ipp.c b/scheduler/ipp.c index 44e2512738..0b016f31e6 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -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; } diff --git a/scheduler/printers.c b/scheduler/printers.c index 7c5090f2b2..2055b648b2 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -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))