cups-browsed,implicitclass: Do fallback without mediacol #173
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The fallback is required in three cases :
Some printers doesn't support "media-col-database", so in that case we can do a IPP2.0 request without asking for media-col-database. In this case the ipp status returned is
IPP_STATUS_ERROR_BAD_REQUEST.Some printer doesn't support IPP2.0 and return error
IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED, so in this case we do a IPP1.1 request.In some case, the ipp status is null, but still no information is returned from the printer, the printer only returns
attributes-natural-languageandattribute charset, in this case, we can do one of the above fallback to get better output.Implementation
First we do a normal IPP 2.0 request with requested attributes {"all", "media-col-database"}, if it fails we do a IPP1.1 request, and if that also fails we do a request without asking for media-col-database.
Testing