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

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


The following commit(s) were added to refs/heads/10.1.x by this push:
     new f14a31b109 Add API that allows the error status for the response to be 
reset
f14a31b109 is described below

commit f14a31b1092310a2ed74669ee63400fa9efb9ecd
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 f1e496e681..b5906ed7f8 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -406,6 +406,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 b1d88ee267..bc29233776 100644
--- a/java/org/apache/coyote/Response.java
+++ b/java/org/apache/coyote/Response.java
@@ -342,6 +342,11 @@ public final class Response {
     }
 
 
+    public void resetError() {
+        errorState.set(0);
+    }
+
+
     // -------------------- Methods --------------------
 
     public void reset() throws IllegalStateException {
@@ -634,7 +639,7 @@ public final class Response {
         committed = false;
         commitTimeNanos = -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