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

markt-asf 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 a28c35055a Clear per request error marker when request is recycled
a28c35055a is described below

commit a28c35055ab11d35929ad564beb1a23a67b39546
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Aug 24 17:18:31 2026 +0100

    Clear per request error marker when request is recycled
---
 java/org/apache/coyote/http2/StreamProcessor.java | 4 ++--
 webapps/docs/changelog.xml                        | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/StreamProcessor.java 
b/java/org/apache/coyote/http2/StreamProcessor.java
index 82cae3fe53..8833ad76f9 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -153,6 +153,8 @@ class StreamProcessor extends AbstractProcessor implements 
NonPipeliningProcesso
                          * statistics updating in StreamProcessor.recycle() 
needs to happen before the request and
                          * response are added to the pool to avoid concurrency 
issues corrupting the statistics.
                          */
+                        // Notes are not reset when request is recycled but 
this is a per request note
+                        request.setNote(Request.NOTE_BAD_REQUEST, null);
                         recycle();
                         stream.recycle();
                     }
@@ -523,8 +525,6 @@ class StreamProcessor extends AbstractProcessor implements 
NonPipeliningProcesso
         // - invalid (incorrectly formatted) :authority header
         // - invalid (incorrectly formatted) host header
         if (request.getNote(Request.NOTE_BAD_REQUEST) != null) {
-            // Notes not reset when request is recycled
-            request.setNote(Request.NOTE_BAD_REQUEST, null);
             return false;
         }
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index dc06028581..7b7278af9c 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -269,6 +269,10 @@
         Reject HTTP/1.0 or earlier requests that send a
         <code>transfer-encoding</code> header. (markt)
       </fix>
+      <fix>
+        Ensure per request HTTP/2 bad request marker is cleared when the 
request
+        is recycled. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to