From: Michael R Sweet Date: Mon, 8 Mar 2021 00:46:26 +0000 (-0500) Subject: Add document-format-preferred and include image/urf in the TXT record. X-Git-Tag: v2.4b1~188^2~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63624e0717236167796c220ee20be152b6eaeeae;p=thirdparty%2Fcups.git Add document-format-preferred and include image/urf in the TXT record. --- diff --git a/scheduler/printers.c b/scheduler/printers.c index 306ebfb363..4f5b60e299 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -3610,6 +3610,8 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */ ipp_attribute_t *attr; /* document-format-supported attribute */ char mimetype[MIME_MAX_SUPER + MIME_MAX_TYPE + 2]; /* MIME type name */ + const char *preferred = "image/urf"; + /* document-format-preferred value */ /* @@ -3655,6 +3657,9 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */ cupsArrayDelete(filters); cupsArrayAdd(p->filetypes, type); + + if (!strcasecmp(mimetype, "application/pdf")) + preferred = "application/pdf"; } else cupsdLogMessage(CUPSD_LOG_DEBUG2, @@ -3692,6 +3697,8 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */ attr->values[i].string.text = _cupsStrAlloc(mimetype); } + ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_MIMETYPE), "document-format-preferred", NULL, preferred); + #ifdef HAVE_DNSSD { char pdl[1024]; /* Buffer to build pdl list */ @@ -3739,6 +3746,8 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */ strlcat(pdl, "image/png,", sizeof(pdl)); else if (!_cups_strcasecmp(type->type, "pwg-raster")) strlcat(pdl, "image/pwg-raster,", sizeof(pdl)); + else if (!_cups_strcasecmp(type->type, "urf")) + strlcat(pdl, "image/urf,", sizeof(pdl)); } }