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 2a3d9c5c1b Add API that allows the error status for the response to be 
reset
2a3d9c5c1b is described below

commit 2a3d9c5c1ba7f7733171beb82fda254c4e73769c
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Apr 18 19:45:41 2024 +0100

    Add API that allows the error status for the response to be reset
    
    This is required to fix an issue with async where a dispatch after an
    error is still flagged as an error which causes the dispatch to be
    skipped.
---
 java/org/apache/catalina/connector/Response.java | 5 +++++
 java/org/apache/coyote/Response.java             | 7 ++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/connector/Response.java 
b/java/org/apache/catalina/connector/Response.java
index 06b0e4fad7..d751dc231f 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -429,6 +429,11 @@ public class Response implements HttpServletResponse {
     }
 
 
+    public void resetError() {
+        getCoyoteResponse().resetError();
+    }
+
+
     /**
      * Perform whatever actions are required to flush and close the output 
stream or writer, in a single operation.
      *
diff --git a/java/org/apache/coyote/Response.java 
b/java/org/apache/coyote/Response.java
index 4af1c8a4c7..6ff483b09e 100644
--- a/java/org/apache/coyote/Response.java
+++ b/java/org/apache/coyote/Response.java
@@ -332,6 +332,11 @@ public final class Response {
     }
 
 
+    public void resetError() {
+        errorState.set(0);
+    }
+
+
     // -------------------- Methods --------------------
 
     public void reset() throws IllegalStateException {
@@ -624,7 +629,7 @@ public final class Response {
         committed = false;
         commitTime = -1;
         errorException = null;
-        errorState.set(0);
+        resetError();
         headers.recycle();
         trailerFieldsSupplier = null;
         // Servlet 3.1 non-blocking write listener


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

Reply via email to