Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUPS uses different get-printer-attributes requests for polling IPP printer capabilities at different places #5484

Closed
tillkamppeter opened this issue Jan 17, 2019 · 5 comments

Comments

@tillkamppeter
Copy link

CUPS generates PPD files for driverless IPP printing at 3 places and at each place it uses a different get-printer-attributes IPP request for obtaining the printer capability info which could lead to different PPD files. The IPP requests differ only by their "requested-attributes" attribute. These are the 3 places:

  1. The lpadmin utility (with "-m everywhere", file systemv/lpadmin.c) supplies the list {"job-template", "printer-defaults", "printer-description", "media-col-database"} as "requested-attributes" attribute.
  2. The scheduler (function create_local_bg_thread() in scheduler/ipp.c) simply uses {"all"}.
  3. The CUPS web interface (get_printer_ppd() function in cgi-bin/admin.c) does not add a "requested-attributes" attribute at all.

In addition, ipptool does not supply a "requested-attributes" attribute (like the web interface) with the old get-printer-attributes.test and uses {"all", "media-col-database"} with the new get-printer-attributes-2.0.test.
I have found out this when trying to find a fix for cups-filters issue #22 for which I got the this pull request. It made the impression that the way I do it in cups-filters (it is the method of lpadmin) is wrong and checked how CUPS actually does it.
What is the "correct" standard-conforming method? CUPS should use this method at every place.

@tillkamppeter
Copy link
Author

@mark246, could you also test your printer with CUPS itself and report here?
You do not need to edit the source code of CUPS. Do the following (and capture the IPP request with tshark):

  1. Use lpadmin ... -m everywhere ... to create a print queue.
  2. Remove all queues for your printer, run lpstat -e and print to the queue name suggested by this conmand (using lp -d ..., print dialogs often do not offer this printer as there is no permanent queue for it).
  3. Create a print queue with the CUPS web interface (http://localhost:631/).
  4. Run the command ipptool -tv <URI> get-printer-attributes-2.0.test > out.txt (<URI> is your printer's URI, output of the driverless command).

Please attach all the results (tshark output, generated PPD files, ...) here.

@michaelrsweet
Copy link
Collaborator

@tillkamppeter The lpadmin list or "all" and "media-col-database" will contain the complete set of attributes needed. Without "media-col-database" being requested explicitly, the generated PPD will not contain proper margin information.

Queued up for the next 2.2.x release...

@michaelrsweet
Copy link
Collaborator

[master 622207e] Use the same requested-attributes values for all IPP Everywhere setup requests (Issue #5484)

[branch-2.2 f3693bb] Use the same requested-attributes values for all IPP Everywhere setup requests (Issue #5484)

@tillkamppeter
Copy link
Author

Why did you use {"job-template", "printer-defaults", "printer-description", "media-col-database"} and not simply {"all", "media-col-database"}?
For the printer in cups-filters issue #22 the "urf-supported" attributes only appears with "all" or when explicitly mentioned in the request (and for ipptool you also use {"all", "media-col-database"}).

@michaelrsweet
Copy link
Collaborator

@tillkamppeter Because "all" should not be necessary/used for this particular case. But obviously we have a POS printer that doesn't following the &$!^%%# standards.

I will change them to "all" and "media-col-database".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants