Skip to content

Commit ae5f04b

Browse files
committed
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.
1 parent b65a95c commit ae5f04b

3 files changed

Lines changed: 37 additions & 0 deletions

File tree

scheduler/filter.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,15 @@ mime_get_filter_types(
614614
src = (mime_type_t *)cupsArrayGetElement(c->srcs, i);
615615

616616
if (!strcmp(src->super, "printer"))
617+
{
618+
if (level < 4)
619+
{
620+
// Add filters that can convert to this type...
621+
srcs = mime_get_filter_types(mime, src, srcs, level + 1);
622+
}
623+
617624
continue;
625+
}
618626

619627
if (!cupsArrayFind(srcs, src))
620628
{

scheduler/ipp.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5376,6 +5376,8 @@ create_local_bg_thread(
53765376
}
53775377
else
53785378
{
5379+
ipp_tag_t group; /* Current group tag */
5380+
53795381
cupsdLogPrinter(printer, CUPSD_LOG_ERROR, "PPD creation failed: %s", cupsGetErrorString());
53805382

53815383
/* Force printer to timeout and be deleted */
@@ -5385,6 +5387,31 @@ create_local_bg_thread(
53855387
cupsRWUnlock(&printer->lock);
53865388

53875389
send_ipp_status(con, IPP_STATUS_ERROR_DEVICE, _("Unable to create PPD: %s"), cupsGetErrorString());
5390+
5391+
cupsdLogClient(con, CUPSD_LOG_DEBUG, "Printer attributes:");
5392+
5393+
for (group = IPP_TAG_ZERO, attr = ippFirstAttribute(response); attr; attr = ippNextAttribute(response))
5394+
{
5395+
const char *name; /* Attribute name */
5396+
char value[1024]; /* Attribute value */
5397+
5398+
if (group != ippGetGroupTag(attr))
5399+
{
5400+
group = ippGetGroupTag(attr);
5401+
if (group != IPP_TAG_ZERO)
5402+
cupsdLogClient(con, CUPSD_LOG_DEBUG, "%s", ippTagString(group));
5403+
}
5404+
5405+
if ((name = ippGetName(attr)) == NULL)
5406+
continue;
5407+
5408+
ippAttributeString(attr, value, sizeof(value));
5409+
5410+
cupsdLogClient(con, CUPSD_LOG_DEBUG, "%s %s%s '%s'", name, ippGetCount(attr) > 1 ? "1setOf " : "", ippTagString(ippGetValueTag(attr)), value);
5411+
}
5412+
5413+
cupsdLogClient(con, CUPSD_LOG_DEBUG, "end-of-attributes-tag");
5414+
53885415
goto finish_response;
53895416
}
53905417

scheduler/printers.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3550,6 +3550,8 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */
35503550
* Otherwise, get the list of supported source types...
35513551
*/
35523552

3553+
cupsdLogPrinter(p, CUPSD_LOG_DEBUG2, "add_printer_formats: filetype=%s/%s", p->filetype ? p->filetype->super : "null", p->filetype ? p->filetype->type : "null");
3554+
35533555
p->filetypes = mimeGetFilterTypes(MimeDatabase, p->filetype, NULL);
35543556

35553557
if ((type = mimeType(MimeDatabase, "application", "pdf")) != NULL && cupsArrayFind(p->filetypes, type))

0 commit comments

Comments
 (0)