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

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


The following commit(s) were added to refs/heads/11.0.x by this push:
     new 7057906045 Clear per request error marker when request is recycled
7057906045 is described below

commit 70579060454a203977b5696ece71e7cbd6ee9bde
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 47ae34dee7..a7c3062c9c 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();
                     }
@@ -506,8 +508,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 2887a7aae8..bdfef89e0d 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -261,6 +261,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