You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into some issues using the ResponseDecoder that give me the impression that it's not (never been) working and/or currently a work in progress. E.g. the test cases in response_test.go are all marked SKIP :)
Just wanted to confirm my suspicion before I change anything.
The response I am trying to decode contains a 'unsupported' group. Decoding this is not implemented, in fact the 0x05 "Unsupported Group" tag is not being taken into consideration. In my specific case this results in the next byte, a value tag being interpreted as the 1st byte of a length field which wreaks havoc.
Digging further leads me to believe (and I sincerely hope I am not stepping on anyone's toes here) that the Response Decoder is a hot mess that has not seen much use and is included more or less as a placeholder. Decodeshould try to match 0 or more groups (RFC 8010 Ch 3.1.1.), instead it just tries to match Attributes and then retroactively recognize and group the collected attributes (or something like that).
I've created a pull request (#42) that hopefully illustrated the issue and an additional test case that attempts to decode the actual Response that triggered my problems. I don't think it would be too much of a hassle to write a proper Decode function and I would be willing to do it, if you wish. But it would probably be easier to just throw out the previous function and reimplement from scratch, so I wanted to ask ahead if there's interest or if I am missing something obvious.
Here is my Response, the amended PR ilustrating the issue is here #42 .
I know that part of the library is hacky and that the library itself is missing some ipp functions. It was originally written to orchestrate a farm of cups servers, so I only implemented what was needed at the time.
If you want to rework the request decode i would appreciate it.
I updated the pullrequest to provide a fix for decoding Responses. My code would probably be helped with a lot more sample IPP messages, but I currently don't have any on hand :)
Anyway, let me know if you have any questions or if there's anything else I can do!
I ran into some issues using the ResponseDecoder that give me the impression that it's not (never been) working and/or currently a work in progress. E.g. the test cases in response_test.go are all marked SKIP :)
Just wanted to confirm my suspicion before I change anything.
The response I am trying to decode contains a 'unsupported' group. Decoding this is not implemented, in fact the 0x05 "Unsupported Group" tag is not being taken into consideration. In my specific case this results in the next byte, a value tag being interpreted as the 1st byte of a length field which wreaks havoc.
Digging further leads me to believe (and I sincerely hope I am not stepping on anyone's toes here) that the Response Decoder is a hot mess that has not seen much use and is included more or less as a placeholder.
Decode
should try to match 0 or more groups (RFC 8010 Ch 3.1.1.), instead it just tries to match Attributes and then retroactively recognize and group the collected attributes (or something like that).I've created a pull request (#42) that hopefully illustrated the issue and an additional test case that attempts to decode the actual Response that triggered my problems. I don't think it would be too much of a hassle to write a proper Decode function and I would be willing to do it, if you wish. But it would probably be easier to just throw out the previous function and reimplement from scratch, so I wanted to ask ahead if there's interest or if I am missing something obvious.
Here is my Response, the amended PR ilustrating the issue is here #42 .
The text was updated successfully, but these errors were encountered: