< prev index next >
src/java.net.http/share/classes/jdk/internal/net/http/Http1Response.java
Print this page
rev 54081 : 8265099: Revert backport to 11u of 8236859: WebSocket over authenticating proxy fails with NPE
Summary: Revert https://hg.openjdk.java.net/jdk-updates/jdk11u-dev/rev/57e3fa3574ec
Reviewed-by:
*** 1,7 ****
/*
! * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 261,271 ****
int clen = (int)headers.firstValueAsLong("Content-Length").orElse(-1);
if (clen == -1 || clen > MAX_IGNORE) {
connection.close();
return MinimalFuture.completedFuture(null); // not treating as error
} else {
! return readBody(discarding(), !request.isWebSocket(), executor);
}
}
// Used for those response codes that have no body associated
public void nullBody(HttpResponse<T> resp, Throwable t) {
--- 261,271 ----
int clen = (int)headers.firstValueAsLong("Content-Length").orElse(-1);
if (clen == -1 || clen > MAX_IGNORE) {
connection.close();
return MinimalFuture.completedFuture(null); // not treating as error
} else {
! return readBody(discarding(), true, executor);
}
}
// Used for those response codes that have no body associated
public void nullBody(HttpResponse<T> resp, Throwable t) {
*** 385,402 ****
}
public <U> CompletableFuture<U> readBody(HttpResponse.BodySubscriber<U> p,
boolean return2Cache,
Executor executor) {
- if (debug.on()) {
- debug.log("readBody: return2Cache: " + return2Cache);
- if (request.isWebSocket() && return2Cache && connection != null) {
- debug.log("websocket connection will be returned to cache: "
- + connection.getClass() + "/" + connection );
- }
- }
- assert !return2Cache || !request.isWebSocket();
this.return2Cache = return2Cache;
final Http1BodySubscriber<U> subscriber = new Http1BodySubscriber<>(p);
final CompletableFuture<U> cf = new MinimalFuture<>();
--- 385,394 ----
< prev index next >