Fix driverless printing on Pantum M7300FDW #826
Closed
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.
According to RFC 8010, attributes within collection must not have name. Instead, name must be encoded as value of special dedicated attribute, IPP_TAG_MEMBERNAME
Unfortunately, some devices violate this specification and encode collection member names as attribute names.
Pantum M7300FDW is know to have this bug in firmware.
So if we have not seen IPP_TAG_MEMBERNAME while decoding the current message, we allow sender to violate this rule and threat attribute name as member name.
It fixes driverless printing on Pantum M7300FDW.
Please note, this change breaks
bad_collection
test in thetestipp.c
, because now it decodes. So I've slightly modified that test, addingIPP_TAG_MEMBERNAME
to the first attribute in the collection - it disactivates the workaround, making sure thatbad_collection
will not be decoded, as expected.I've also added to the test a real-life example of Pantum M7300FDW response to the
Get-Printer-Attributes
request which now decodes.The similar patches already added to https://github.com/OpenPrinting/goipp and https://github.com/OpenPrinting/ipp-usb so with all this stuff taken together, the device becomes fully-functional in the driverless mode (printing/scanning, network/USB, things just work).