src/java.net.http/share/classes/jdk/internal/net/http/common/SubscriberWrapper.java
--- 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();
}
}