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:35 UTC

[tomcat] branch 9.0.x 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 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 6a7dce6  Throw IOE rather than ISE if application tries to write to closed stream
6a7dce6 is described below

commit 6a7dce69bd8348a76be517517f323239476f554c
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 83a061c..7086114 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -839,7 +839,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 c42d010..b94e0d7 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -136,6 +136,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