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 527dd3782c Recycle the request note in the same place as the request
527dd3782c is described below

commit 527dd3782cc8a672577fcfe48b3fa7ef07e97776
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Sep 10 09:00:41 2026 +0100

    Recycle the request note in the same place as the request
    
    No functional change. Just cleaner code.
---
 java/org/apache/coyote/http2/Stream.java          | 2 ++
 java/org/apache/coyote/http2/StreamProcessor.java | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/Stream.java 
b/java/org/apache/coyote/http2/Stream.java
index fd47b34ad9..68a9cde95f 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -957,6 +957,8 @@ class Stream extends AbstractNonZeroStream implements 
HeaderEmitter {
         if (log.isTraceEnabled()) {
             log.trace(sm.getString("stream.recycle.first", getConnectionId(), 
getIdAsString()));
         }
+        // Notes are not reset when request is recycled but this is a per 
request note
+        coyoteRequest.setNote(Request.NOTE_BAD_REQUEST, null);
         coyoteRequest.recycle();
         coyoteResponse.recycle();
         handler.getProtocol().pushRequestAndResponse(coyoteRequest);
diff --git a/java/org/apache/coyote/http2/StreamProcessor.java 
b/java/org/apache/coyote/http2/StreamProcessor.java
index a7c3062c9c..e4da15100f 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -153,8 +153,6 @@ 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();
                     }


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

Reply via email to