src/java.net.http/share/classes/jdk/internal/net/http/common/SubscriberWrapper.java
branchhttp-client-branch
changeset 56463 b583caf69b39
parent 56451 9585061fdb04
child 56507 2294c51eae30
--- a/src/java.net.http/share/classes/jdk/internal/net/http/common/SubscriberWrapper.java	Wed Apr 18 12:55:11 2018 +0100
+++ b/src/java.net.http/share/classes/jdk/internal/net/http/common/SubscriberWrapper.java	Thu Apr 19 16:47:52 2018 +0100
@@ -306,14 +306,16 @@
                                downstreamSubscription);
             }
 
+            boolean datasent = false;
             while (!outputQ.isEmpty() && downstreamSubscription.tryDecrement()) {
                 List<ByteBuffer> b = outputQ.poll();
                 if (debug.on())
                     debug.log("DownstreamPusher: Pushing %d bytes downstream",
                               Utils.remaining(b));
                 downstreamSubscriber.onNext(b);
+                datasent = true;
             }
-            upstreamWindowUpdate();
+            if (datasent) upstreamWindowUpdate();
             checkCompletion();
         }
     }