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 2026/10/03 15:08:10 UTC

(httpcomponents-core) branch 5.4.x updated: AbstractHttp1StreamDuplexer should not trigger output interest when completion of a message leaves no data in the output buffer

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

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


The following commit(s) were added to refs/heads/5.4.x by this push:
     new 7931e30e9 AbstractHttp1StreamDuplexer should not trigger output interest when completion of a message leaves no data in the output buffer
7931e30e9 is described below

commit 7931e30e984edf7d7f67e3e05fd25081c68fb487
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sat Oct 3 16:45:28 2026 +0200

    AbstractHttp1StreamDuplexer should not trigger output interest when completion of a message leaves no data in the output buffer
---
 .../apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java
index 7b37ca47b..df70e4327 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java
@@ -534,7 +534,9 @@ MessageDelineation endOutputStream(final List<? extends Header> trailers) throws
             }
             final ContentEncoder contentEncoder = outgoingMessage.getBody();
             contentEncoder.complete(trailers);
-            ioSession.setEvent(SelectionKey.OP_WRITE);
+            if (outbuf.hasData()) {
+                ioSession.setEvent(SelectionKey.OP_WRITE);
+            }
             outgoingMessage = null;
             return contentEncoder instanceof ChunkEncoder
                             ? MessageDelineation.CHUNK_CODED