You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2022/12/19 14:53:40 UTC
[tomcat] branch 9.0.x updated: Fix BZ 66382 - read timeout bug with HTTP/2 and NIO2
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 662ebf1bf9 Fix BZ 66382 - read timeout bug with HTTP/2 and NIO2
662ebf1bf9 is described below
commit 662ebf1bf9f1a5001d935018e845776bc1b1ffe0
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 4e76b12c0c..305cc5be0d 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 ab3f798683..fe4271410c 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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org