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 2018/12/08 14:12:21 UTC

httpcomponents-core git commit: Asynchronous HTTP connections must not suspend output if there is buffered output data

Repository: httpcomponents-core
Updated Branches:
  refs/heads/4.4.x 0766e07e3 -> 769fba99e


Asynchronous HTTP connections must not suspend output if there is buffered output data


Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/769fba99
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/769fba99
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/769fba99

Branch: refs/heads/4.4.x
Commit: 769fba99ef17b84a0844f4f611b0e0fde34cb998
Parents: 0766e07
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Sat Dec 8 15:11:50 2018 +0100
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Sat Dec 8 15:11:50 2018 +0100

----------------------------------------------------------------------
 .../java/org/apache/http/impl/nio/NHttpConnectionBase.java     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/769fba99/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java b/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java
index 0b1fb05..0609c31 100644
--- a/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java
+++ b/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java
@@ -365,7 +365,11 @@ public class NHttpConnectionBase
 
     @Override
     public void suspendOutput() {
-        this.session.clearEvent(EventMask.WRITE);
+        synchronized (this.session) {
+            if (!this.outbuf.hasData()) {
+                this.session.clearEvent(EventMask.WRITE);
+            }
+        }
     }
 
     /**