This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push: new 31305477d6 Fix BZ 66382 - read timeout bug with HTTP/2 and NIO2 31305477d6 is described below commit 31305477d62d72fa31593c998e851a69aeb37a0b Author: Mark Thomas <ma...@apache.org> AuthorDate: Mon Dec 19 14:52:34 2022 +0000 Fix BZ 66382 - read timeout bug with HTTP/2 and NIO2 https://bz.apache.org/bugzilla/show_bug.cgi?id=66385 --- java/org/apache/coyote/http2/Http2AsyncParser.java | 6 ++++-- webapps/docs/changelog.xml | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/java/org/apache/coyote/http2/Http2AsyncParser.java b/java/org/apache/coyote/http2/Http2AsyncParser.java index d01497051d..a2043557b7 100644 --- a/java/org/apache/coyote/http2/Http2AsyncParser.java +++ b/java/org/apache/coyote/http2/Http2AsyncParser.java @@ -134,8 +134,10 @@ class Http2AsyncParser extends Http2Parser { ByteBuffer header = ByteBuffer.allocate(9); ByteBuffer framePayload = ByteBuffer.allocate(input.getMaxFrameSize()); FrameCompletionHandler handler = new FrameCompletionHandler(expected, header, framePayload); - CompletionState state = - socketWrapper.read(block ? BlockingMode.BLOCK : BlockingMode.NON_BLOCK, socketWrapper.getReadTimeout(), TimeUnit.MILLISECONDS, null, handler, handler, header, framePayload); + CompletionState state = socketWrapper.read( + block ? BlockingMode.BLOCK : BlockingMode.NON_BLOCK, + block ? socketWrapper.getReadTimeout() : 0, + TimeUnit.MILLISECONDS, null, handler, handler, header, framePayload); if (state == CompletionState.ERROR || state == CompletionState.INLINE) { handleAsyncException(); return true; diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 2149041f04..6d5149ebac 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -123,6 +123,11 @@ code <code>NO_ERROR</code> so that client does not discard the response. Based on a suggestion by Lorenzo Dalla Vecchia. (markt) </fix> + <fix> + <bug>66385</bug>: Correct a bug in HTTP/2 where a non-blocking read for + a new frame with the NIO2 connector was incorrectly made using the read + timeout leading to unexpected stream closure. (markt) + </fix> </changelog> </subsection> </section> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org