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 2026/09/30 09:39:51 UTC

(tomcat) 02/07: Record an error in CoyoteWriter.close() when the underlying OutputBuffer close fails, rather than swallowing the IOException silently, so checkError() reflects the failure

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

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

commit 2bd3cd8e52fe1083a71560b3f81052f63d3fd717
Author: opencode <re...@apache.org>
AuthorDate: Wed Sep 30 10:51:55 2026 +0200

    Record an error in CoyoteWriter.close() when the underlying OutputBuffer close fails, rather than swallowing the IOException silently, so checkError() reflects the failure
---
 java/org/apache/catalina/connector/CoyoteWriter.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/connector/CoyoteWriter.java b/java/org/apache/catalina/connector/CoyoteWriter.java
index 0cfc488aa8..06a41338ed 100644
--- a/java/org/apache/catalina/connector/CoyoteWriter.java
+++ b/java/org/apache/catalina/connector/CoyoteWriter.java
@@ -111,12 +111,16 @@ public class CoyoteWriter extends PrintWriter {
     @Override
     public void close() {
 
+        if (error) {
+            return;
+        }
+
         // We don't close the PrintWriter - super() is not called,
         // so the stream can be reused. We close ob.
         try {
             ob.close();
-        } catch (IOException ignore) {
-            // Ignore
+        } catch (IOException ioe) {
+            setErrorException(ioe);
         }
 
     }


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