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/03/09 09:53:16 UTC

[tomcat] branch main updated: Throw IOE rather than ISE if application tries to write to closed stream

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

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


The following commit(s) were added to refs/heads/main by this push:
     new b738fa6  Throw IOE rather than ISE if application tries to write to closed stream
b738fa6 is described below

commit b738fa6ee0e6789b104e652d95c982827e9753dd
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Mar 9 09:52:49 2022 +0000

    Throw IOE rather than ISE if application tries to write to closed stream
---
 java/org/apache/coyote/http2/Stream.java | 2 +-
 webapps/docs/changelog.xml               | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/http2/Stream.java b/java/org/apache/coyote/http2/Stream.java
index 076226f..a142836 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -844,7 +844,7 @@ class Stream extends AbstractNonZeroStream implements HeaderEmitter {
         @Override
         public final synchronized int doWrite(ByteBuffer chunk) throws IOException {
             if (closed) {
-                throw new IllegalStateException(
+                throw new IOException (
                         sm.getString("stream.closed", getConnectionId(), getIdAsString()));
             }
             // chunk is always fully written
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f09364a..edcbdb6 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -141,6 +141,12 @@
         processing to wait, and potentially timeout, waiting for additional
         data when the full request has been received. (markt)
       </fix>
+      <fix>
+        Throw <code>IOException</code> rather than
+        <code>IllegalStateException</code> when the application attempts to
+        write to an GHTTP/2 stream after the client has closed the stream.
+        (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">

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