]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix TXT record.
authorMichael R Sweet <msweet@msweet.org>
Tue, 9 Mar 2021 01:20:34 +0000 (20:20 -0500)
committerMichael R Sweet <msweet@msweet.org>
Tue, 9 Mar 2021 01:20:34 +0000 (20:20 -0500)
Don't include application/octet-stream in pdl value.

scheduler/dirsvc.c
scheduler/printers.c

index 93524c914eb8fcc288ead8ac19b6723bd38e5e40..b4d67a92aaa9ca610bc43c7ed57c540151a4bf4d 100644 (file)
@@ -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;
index 8aa9fa0f917c124342197c6086411c05c92ad814..90b4f31c5168b16dd8126669f3d8ad84b0c8a202 100644 (file)
@@ -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 */