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

commit 3909b228ed6ddd6cbe7223d8e6796aac024620a1
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 b4acd37e61..7706e8d509 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -968,6 +968,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 8833ad76f9..1db3306e08 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