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

markt-asf 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 64932b125e Recycle the request note in the same place as the request
64932b125e is described below

commit 64932b125e0220ccce4101fb3bbadad8a8b868fa
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 681fd465dc..b1c9e71ad3 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -958,6 +958,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