* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Carl wrote:
As an implementor, I'd really prefer to be allowed to bail as soon as a syntax error is detected. It can be dangerous to proceed. For example, the parser might be expecting the next field to be an attribute length, but if it's actually a string or something, due to a syntax error, the parser might end up trying to allocate a string buffer of a gazillion bytes, crashing the application. Of course, you can build in protection against this kind of thing, and scan for patterns to try to resynch to the data stream, etc. But that all adds complexity.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Though I agree that it is generally dangerous to proceed parsing a message that has already been determined to be invalid, the risk of parsing up to the "attribute charset" attribute is next to none-existent given that it is always found at the exact same location in the IPP message. If the "attribute-charset" attribute is itself corrupted, the parser must know how to handle it whether a problem has already been detected with the message or not.
-Hugo