8297424: java/net/httpclient/AsyncExecutorShutdown.java fails in AssertionError due to misplaced assert
Reviewed-by: jpai
This commit is contained in:
parent
361b50e724
commit
5d2772a43e
src/java.net.http/share/classes/jdk/internal/net/http
@ -549,13 +549,13 @@ public class ResponseSubscribers {
|
||||
closed = this.closed;
|
||||
if (!closed) {
|
||||
this.subscription = s;
|
||||
assert buffers.remainingCapacity() > 1; // should contain at least 2
|
||||
}
|
||||
}
|
||||
if (closed) {
|
||||
s.cancel();
|
||||
return;
|
||||
}
|
||||
assert buffers.remainingCapacity() > 1; // should contain at least 2
|
||||
if (debug.on())
|
||||
debug.log("onSubscribe: requesting "
|
||||
+ Math.max(1, buffers.remainingCapacity() - 1));
|
||||
|
@ -175,10 +175,9 @@ class Stream<T> extends ExchangeImpl<T> {
|
||||
if (subscriber == null) {
|
||||
// can't process anything yet
|
||||
return;
|
||||
} else {
|
||||
if (debug.on()) debug.log("subscribing user subscriber");
|
||||
subscriber.onSubscribe(userSubscription);
|
||||
}
|
||||
if (debug.on()) debug.log("subscribing user subscriber");
|
||||
subscriber.onSubscribe(userSubscription);
|
||||
}
|
||||
while (!inputQ.isEmpty()) {
|
||||
Http2Frame frame = inputQ.peek();
|
||||
@ -417,7 +416,7 @@ class Stream<T> extends ExchangeImpl<T> {
|
||||
responseBodyCF.completeExceptionally(t);
|
||||
}
|
||||
|
||||
// ensure that the body subscriber will be subsribed and onError() is
|
||||
// ensure that the body subscriber will be subscribed and onError() is
|
||||
// invoked
|
||||
pendingResponseSubscriber = bodySubscriber;
|
||||
sched.runOrSchedule(); // in case data waiting already to be processed, or error
|
||||
@ -534,9 +533,9 @@ class Stream<T> extends ExchangeImpl<T> {
|
||||
Flow.Subscriber<?> subscriber =
|
||||
responseSubscriber == null ? pendingResponseSubscriber : responseSubscriber;
|
||||
if (response == null && subscriber == null) {
|
||||
// we haven't receive the headers yet, and won't receive any!
|
||||
// we haven't received the headers yet, and won't receive any!
|
||||
// handle reset now.
|
||||
handleReset(frame, subscriber);
|
||||
handleReset(frame, null);
|
||||
} else {
|
||||
// put it in the input queue in order to read all
|
||||
// pending data frames first. Indeed, a server may send
|
||||
|
Loading…
x
Reference in New Issue
Block a user