You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2025/01/03 14:51:28 UTC

(httpcomponents-core) branch master updated: Minor performance optimization in handling of HEAD requests by the H2 transport

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

olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git


The following commit(s) were added to refs/heads/master by this push:
     new bb63f07ff Minor performance optimization in handling of HEAD requests by the H2 transport
bb63f07ff is described below

commit bb63f07ff0b42410ba65cbf1a36dcb986d0f2c64
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Fri Jan 3 15:48:06 2025 +0100

    Minor performance optimization in handling of HEAD requests by the H2 transport
---
 .../java/org/apache/hc/core5/http2/impl/nio/ServerH2StreamHandler.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerH2StreamHandler.java b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerH2StreamHandler.java
index 508702508..eaf53a7ac 100644
--- a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerH2StreamHandler.java
+++ b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerH2StreamHandler.java
@@ -179,7 +179,7 @@ class ServerH2StreamHandler implements H2StreamHandler {
                     receivedRequest != null && Method.HEAD.isSame(receivedRequest.getMethod());
             outputChannel.submit(responseHeaders, endStream);
             connMetrics.incrementResponseCount();
-            if (responseEntityDetails == null) {
+            if (endStream) {
                 responseState = MessageState.COMPLETE;
             } else {
                 responseState = MessageState.BODY;