apple / cups

Apple CUPS Sources
https://www.cups.org
Apache License 2.0
1.91k stars 464 forks source link

cupsGetDests2 only shows Discovered printer when using http=CUPS_HTTP_DEFAULT #5925

Open cregganna opened 3 years ago

cregganna commented 3 years ago

Not sure if this is actually an issue - I'm looking more for advice on whether this is a setup issue or just that one should be using cupsEnumDests rather than cupsGetDests2.

I have a Linux application that uses cupsGetDests2 with http=CUPS_HTTP_DEFAULT to enumerate the printers to present to the user. It mostly fails to show the only printer on the network - all other applications on the box correctly show the printer is available.

The setup is:

The application concerned tries to filter out the CUPS_PRINTER_DISCOVERED printer after calling the cupsGetDests2 and this results in no printers being available.

Sorry about the long ramble but finally to my questions:

Your inputs on this would be very appreciated.

cregganna commented 3 years ago

Hi again, Just gently giving this a bump.

Can we have some direction on this please - maybe answering the question:

Many Thanks

michaelrsweet commented 3 years ago

@cregganna You should probably report this to the OpenPrinting CUPS repository, as Apple is no longer providing assistance for Linux users of CUPS and my access to this repository is extremely limited at the moment...

That said, cupsGetDests2 and cupsEnumDests should return substantially the same list of destinations since cupsGetDests2 is implemented using cupsEnumDests in CUPS 2.3.x - the only differences might be for printers that don't response immediately to a discovery query. Generally speaking, interactive applications should use cupsEnumDests while non-interactive applications should use cupsGetDests2.

As for why you aren't seeing the printer, cups-browsed will normally create a queue for every printer it sees (which is actually not what I'd like to see, since CUPS can dynamically create a queue as needed), but the "discovered" queue can be used with the CUPS API and CUPS will automatically create a queue for it.

michaelrsweet commented 3 years ago

@cregganna Oh, and just re-reading your original message, cupsGetDests2 only enumerates printers when the HTTP connection is local (either CUPS_HTTP_DEFAULT or an explicit connection to the domain socket or localhost IP sockets...)

cregganna commented 3 years ago

Michael, thanks for your reply - I did not fully understand that the cups running on my own Linux box was not from this repo - I will post the same question in OpenPrinting CUPS.

Note though, that Apple users are also reporting this issue.