Skip to content

Fix IppResponseException generated when responding to a request with bad request-id value - #44

Merged
danielklecha merged 2 commits into
danielklecha:masterfrom
61131:fix-response-bad-value
Nov 19, 2026
Merged

danielklecha merged 2 commits into
danielklecha:masterfrom
61131:fix-response-bad-value

Conversation

@61131

@61131 61131 commented Nov 19, 2026

Copy link
Copy Markdown

An unhandled IppResponseException was raised when executing the ipp-1.1.test against IppPrinter. This exception was caused by IppResponseMessageValidator.ValidateCore when validating the request-id value copied into the response message. However, this field should not be validated when generating a response.

From RFC 8011 4.1.2:

For each request, the Client chooses the "request-id", which MUST be an integer (possibly unique, depending on Client requirements) in the range from 1 to 2**31 - 1 (inclusive). This "request-id" allows Clients to manage multiple outstanding requests. The receiving IPP object (Printer, Job, etc.) copies all 32 bits of the Client-supplied "request-id" attribute into the response so that the Client can match the response with the correct outstanding request, even if the "request-id" is out of range.

As such, where a request is submitted with an invalid request-id, SharpIppNext must be able to create a response message with an invalid request-id in order to provide a meaningful response. This PR removes the request-id validation from the IppResponseMessageValidator and the corresponding test.

@danielklecha

Copy link
Copy Markdown
Owner

@61131 thank! I agree. I made small changes. I will merge it.

@danielklecha
danielklecha merged commit 15d854b into danielklecha:master Nov 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants