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

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

The following commit(s) were added to refs/heads/8.5.x by this push:
     new 73421b8  Refactor stream reset when cancelling in an progress upload
73421b8 is described below

commit 73421b8af6e840268e1552e4c9c44067f1966d4d
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Mar 11 10:29:21 2021 +0000

    Refactor stream reset when cancelling in an progress upload
    
    Using the pre-existing method means better error handling if the RST
    frame fails and better logging.
---
 java/org/apache/coyote/http2/StreamProcessor.java | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/coyote/http2/StreamProcessor.java 
b/java/org/apache/coyote/http2/StreamProcessor.java
index ce4871b..9b5a948 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -425,17 +425,16 @@ class StreamProcessor extends AbstractProcessor {
     }
 
 
-    private void endRequest() throws IOException {
+    private void endRequest() {
         if (!stream.isInputFinished() && getErrorState().isIoAllowed()) {
             // The request has been processed but the request body has not been
             // fully read. This typically occurs when Tomcat rejects an upload
             // of some form (e.g. PUT or POST). Need to tell the client not to
-            // send any more data but only if a reset has not already been
-            // triggered.
+            // send any more data on this stream (reset).
             StreamException se = new StreamException(
                     sm.getString("streamProcessor.cancel", 
stream.getConnectionId(),
                             stream.getIdAsString()), Http2Error.CANCEL, 
stream.getIdAsInt());
-            handler.sendStreamReset(se);
+            stream.close(se);
         }
     }
 }


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

Reply via email to