http-client-branch: review comment: HTTP/1.1 Publisher should publish WHILE there is demand and outgoing http-client-branch
authorchegar
Sun, 03 Dec 2017 20:56:29 +0000
branchhttp-client-branch
changeset 55945 94fd10959e8b
parent 55944 b7e186aa1915
child 55946 cfa4f84b7fcc
http-client-branch: review comment: HTTP/1.1 Publisher should publish WHILE there is demand and outgoing
src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1Exchange.java
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1Exchange.java	Sun Dec 03 22:34:23 2017 +0300
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1Exchange.java	Sun Dec 03 20:56:29 2017 +0000
@@ -557,7 +557,7 @@
                     return;
                 }
                 debug.log(Level.DEBUG, () -> "hasOutgoing = " + hasOutgoing());
-                if (hasOutgoing() && demand.tryDecrement()) {
+                while (hasOutgoing() && demand.tryDecrement()) {
                     DataPair dp = getOutgoing();
 
                     if (dp.throwable != null) {