arturobernalg opened a new pull request, #1251: URL: https://github.com/apache/tomcat/pull/1251
When the server resets a stream and the application thread then fails to write to it, a second RST_STREAM (STREAM_CLOSED) is sent for the same stream. For example, if the request body is longer than its content-length, the connection thread sends RST_STREAM (PROTOCOL_ERROR), the servlet then tries to write the response and Tomcat sends another reset. RFC 9113, section 5.1 says an endpoint must not send frames other than PRIORITY on a closed stream, and section 5.4.2 says an endpoint should not normally send more than one RST_STREAM for a stream. The exception (more resets when frames keep arriving on the closed stream after a round-trip time) does not apply here. StreamStateMachine.sendReset() now reports whether a reset has already been sent and sendStreamReset() skips the frame if so. The check is made under the lock that was already there to keep the state change and the write together. A reset sent after the client has reset the stream is not changed, as there are tests that expect it. Checked on a running Tomcat with a raw HTTP/2 client: one RST_STREAM instead of two. The HTTP/2 tests pass. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
