Re: [LOW] STR #4159: For a raw queue pointing to a remote CUPS server via dnssd URI the options of the server's PPD are not shown by print dialogs

Michael Sweet <[email protected]>
Newsgroups gmane.comp.printing.cups.bugs
Message-ID <[email protected]>
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Closed w/Resolution]

Fixed in Subversion repository.

Link: http://www.cups.org/str.php?L4159
Version: 1.6.1
Fix Version: 1.7-current (r10577)

_______________________________________________
cups-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/cups-bugs
str4159.patch (text/plain, 1.6 KB)
Index: cups/util.c
===================================================================
--- cups/util.c	(revision 10572)
+++ cups/util.c	(working copy)
@@ -1636,6 +1636,7 @@
 					/* Hostname associated with connection */
   static const char * const requested_attrs[] =
 		{			/* Requested attributes */
+		  "device-uri",
 		  "member-uris",
 		  "printer-uri-supported",
 		  "printer-type"
@@ -1696,9 +1697,34 @@
 
   if ((response = cupsDoRequest(http, request, "/")) != NULL)
   {
-    if ((attr = ippFindAttribute(response, "member-uris", IPP_TAG_URI)) != NULL)
+    const char *device_uri = NULL;	/* device-uri value */
+
+    if ((attr = ippFindAttribute(response, "device-uri",
+                                 IPP_TAG_URI)) != NULL)
+      device_uri = attr->values[0].string.text;
+
+    if (device_uri &&
+        ((strstr(device_uri, "._ipp.") != NULL ||
+          strstr(device_uri, "._ipps.") != NULL) &&
+         !strcmp(device_uri + strlen(device_uri) - 5, "/cups")))
     {
      /*
+      * Statically-configured Bonjour shared printer.
+      */
+
+      httpSeparateURI(HTTP_URI_CODING_ALL,
+                      _httpResolveURI(device_uri, uri, sizeof(uri),
+                                      _HTTP_RESOLVE_DEFAULT, NULL, NULL),
+                      scheme, sizeof(scheme), username, sizeof(username),
+		      host, hostsize, port, resource, resourcesize);
+      ippDelete(response);
+
+      return (1);
+    }
+    else if ((attr = ippFindAttribute(response, "member-uris",
+                                      IPP_TAG_URI)) != NULL)
+    {
+     /*
       * Get the first actual printer name in the class...
       */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.