You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2019/03/08 17:48:55 UTC

[tomcat] branch master updated: Check stream state after wait

This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
     new a1cb1ac  Check stream state after wait
a1cb1ac is described below

commit a1cb1ac77e3a8fec1b00eb0e944842555da14f7d
Author: remm <re...@apache.org>
AuthorDate: Fri Mar 8 18:48:45 2019 +0100

    Check stream state after wait
    
    Verify HTTP/2 stream is still writable before assuming a timeout
    occurred. The reason for bad behavior is a bit unclear (I see it with
    logging on and async IO), but the check is inconsistent.
---
 java/org/apache/coyote/http2/Stream.java | 2 +-
 webapps/docs/changelog.xml               | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/http2/Stream.java b/java/org/apache/coyote/http2/Stream.java
index 32c90b8..3e64329 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -1052,7 +1052,7 @@ class Stream extends AbstractStream implements HeaderEmitter {
                             throw new IOException(sm.getString("stream.inputBuffer.reset"));
                         }
 
-                        if (inBuffer.position() == 0) {
+                        if (inBuffer.position() == 0 && isActive() && !isInputFinished()) {
                             String msg = sm.getString("stream.inputBuffer.readTimeout");
                             StreamException se = new StreamException(
                                     msg, Http2Error.ENHANCE_YOUR_CALM, getIdAsInt());
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 3269e92..e89dbe3 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -138,6 +138,10 @@
         Ensure enough buffer space when using TLS with NIO2 by using the main
         read buffer to store additional decrypted data. (remm)
       </fix>
+      <fix>
+        Verify HTTP/2 stream is still writable before assuming a timeout
+        occurred. (remm)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="WebSocket">


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org