From: Michael R Sweet Date: Tue, 9 Mar 2021 01:20:34 +0000 (-0500) Subject: Fix TXT record. X-Git-Tag: v2.4b1~188^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e95ce16390d636543f1d8c7d65175701879c5b3c;p=thirdparty%2Fcups.git Fix TXT record. Don't include application/octet-stream in pdl value. --- diff --git a/scheduler/dirsvc.c b/scheduler/dirsvc.c index 93524c914e..b4d67a92aa 100644 --- a/scheduler/dirsvc.c +++ b/scheduler/dirsvc.c @@ -315,7 +315,6 @@ dnssdBuildTxtRecord( char admin_hostname[256], /* Hostname for admin page */ adminurl_str[256], /* URL for the admin page */ type_str[32], /* Type to string buffer */ - state_str[32], /* State to string buffer */ rp_str[256], /* Queue name string buffer */ air_str[256], /* auth-info-required string buffer */ urf_str[256], /* URF string buffer */ @@ -419,8 +418,11 @@ dnssdBuildTxtRecord( if ((urf_supported = ippFindAttribute(p->ppd_attrs, "urf-supported", IPP_TAG_KEYWORD)) != NULL) { + int urf_count = ippGetCount(urf_supported); + // Number of URF values + urf_str[0] = '\0'; - for (i = 0, count = ippGetCount(urf_supported), ptr = urf_str; i < count; i ++) + for (i = 0, ptr = urf_str; i < urf_count; i ++) { const char *value = ippGetString(urf_supported, i, NULL); @@ -504,7 +506,6 @@ dnssdBuildTxtRecord( } snprintf(type_str, sizeof(type_str), "0x%X", p->type | CUPS_PRINTER_REMOTE); - snprintf(state_str, sizeof(state_str), "%d", p->state); keyvalue[count ][0] = "printer-type"; keyvalue[count++][1] = type_str; diff --git a/scheduler/printers.c b/scheduler/printers.c index 8aa9fa0f91..90b4f31c51 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -3720,9 +3720,6 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */ pdl[0] = '\0'; - if (!filter && mimeType(MimeDatabase, "application", "octet-stream")) - strlcat(pdl, "application/octet-stream,", sizeof(pdl)); - /* * Then list a bunch of formats that are supported by the printer... */ @@ -3754,6 +3751,8 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */ if (pdl[0]) pdl[strlen(pdl) - 1] = '\0'; /* Remove trailing comma */ + cupsdLogMessage(CUPSD_LOG_DEBUG, "%s: pdl='%s'", p->name, pdl); + cupsdSetString(&p->pdl, pdl); } #endif /* HAVE_DNSSD */