7199219: Proxy-Connection headers set incorrectly when a HttpClient is retrieved from the Keep Alive Cache

Reviewed-by: chegar
This commit is contained in:
Rob McKenna 2012-09-28 04:39:02 +01:00
parent 80d3fce897
commit 152b0d6143
2 changed files with 5 additions and 2 deletions

View File

@ -36,6 +36,7 @@ import sun.net.www.MeteredStream;
import sun.net.www.ParseUtil;
import sun.net.www.protocol.http.HttpURLConnection;
import sun.util.logging.PlatformLogger;
import static sun.net.www.protocol.http.HttpURLConnection.TunnelState.*;
/**
* @author Herb Jellinek
@ -276,6 +277,8 @@ public class HttpClient extends NetworkClient {
ret.cachedHttpClient = true;
assert ret.inCache;
ret.inCache = false;
if (httpuc != null && ret.needsTunneling())
httpuc.setTunnelState(TUNNELING);
PlatformLogger logger = HttpURLConnection.getHttpLogger();
if (logger.isLoggable(PlatformLogger.FINEST)) {
logger.finest("KeepAlive stream retrieved from the cache, " + ret);

View File

@ -351,7 +351,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
private HttpClient reuseClient = null;
/* Tunnel states */
enum TunnelState {
public enum TunnelState {
/* No tunnel */
NONE,
@ -1740,7 +1740,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
*
* @param the state
*/
void setTunnelState(TunnelState tunnelState) {
public void setTunnelState(TunnelState tunnelState) {
this.tunnelState = tunnelState;
}