------------------------------------
- Updated the maximum file descriptor limit for `cupsd` to 64k-1 (Issue #989)
+- Fixed `lpoptions -d` with a discovered but not added printer (Issue #833)
- Fixed incorrect error message for HTTP/IPP errors (Issue #893)
- Fixed JobPrivateAccess and SubscriptionPrivateAccess support for "all"
(Issue #990)
if (!num_dests || !dests)
return (-1);
+ /*
+ * See if the default destination has a printer URI associated with it...
+ */
+
+ if ((dest = cupsGetDest(/*name*/NULL, /*instance*/NULL, num_dests, dests)) != NULL && !cupsGetOption("printer-uri-supported", dest->num_options, dest->options))
+ {
+ /*
+ * No, try adding it...
+ */
+
+ const char *uri; /* Device/printer URI */
+
+ if ((uri = cupsGetOption("device-uri", dest->num_options, dest->options)) != NULL)
+ {
+ char tempresource[1024]; /* Temporary resource path */
+
+#ifdef HAVE_DNSSD
+ if (strstr(uri, "._tcp"))
+ uri = cups_dnssd_resolve(dest, uri, /*msec*/30000, /*cancel*/NULL, /*cb*/NULL, /*user_data*/NULL);
+#endif /* HAVE_DNSSD */
+
+ if (uri)
+ uri = _cupsCreateDest(dest->name, cupsGetOption("printer-info", dest->num_options, dest->options), NULL, uri, tempresource, sizeof(tempresource));
+
+ if (uri)
+ dest->num_options = cupsAddOption("printer-uri-supported", uri, dest->num_options, &dest->options);
+ }
+ }
+
/*
* Get the server destinations...
*/