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

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


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 5c98e45956 Fix BZ 67235 - fix NPE on dispatch from 
AsyncListener.onError
5c98e45956 is described below

commit 5c98e45956948be37c44dcd142b28f85b0a856db
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Sep 8 18:34:36 2023 +0100

    Fix BZ 67235 - fix NPE on dispatch from AsyncListener.onError
---
 java/org/apache/catalina/connector/CoyoteAdapter.java | 7 +++----
 webapps/docs/changelog.xml                            | 9 +++++++++
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java 
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index 8eacf7a742..b08d6f2833 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -251,10 +251,9 @@ public class CoyoteAdapter implements Adapter {
             AtomicBoolean error = new AtomicBoolean(false);
             res.action(ActionCode.IS_ERROR, error);
             if (error.get()) {
-                if (request.isAsyncCompleting()) {
-                    // Connection will be forcibly closed which will prevent
-                    // completion happening at the usual point. Need to trigger
-                    // call to onComplete() here.
+                if (request.isAsyncCompleting() || 
request.isAsyncDispatching()) {
+                    // Connection will be forcibly closed which will prevent 
completion/dispatch happening at the usual
+                    // point. Trigger post processing here.
                     res.action(ActionCode.ASYNC_POST_PROCESS, null);
                 }
                 success = false;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 0d08a0b809..664ed4ff92 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -113,6 +113,15 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="Coyote">
+    <changelog>
+      <fix>
+        <bug>67235</bug>: Fix a <code>NullPointerException</code> when an
+        <code>AsyncListener</code> handles an error with a dispatch rather than
+        a complete. (markt)
+      </fix>
+    </changelog>
+  </subsection>
 </section>
 <section name="Tomcat 8.5.93 (markt)" rtext="2023-08-25">
   <subsection name="Catalina">


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

Reply via email to