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 21837baca3 Add API that allows the error status for the response to be reset 21837baca3 is described below commit 21837baca3c764608173f4a5c69e85307cf92b18 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 0effa36218..a0d7c8d932 100644 --- a/java/org/apache/catalina/connector/Response.java +++ b/java/org/apache/catalina/connector/Response.java @@ -373,6 +373,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 8bc89249b7..ae157bfd6b 100644 --- a/java/org/apache/coyote/Response.java +++ b/java/org/apache/coyote/Response.java @@ -333,6 +333,11 @@ public final class Response { } + public void resetError() { + errorState.set(0); + } + + // -------------------- Methods -------------------- public void reset() throws IllegalStateException { @@ -656,7 +661,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