提交 05cd8405 编写于 作者: R robm

7199219: Proxy-Connection headers set incorrectly when a HttpClient is...

7199219: Proxy-Connection headers set incorrectly when a HttpClient is retrieved from the Keep Alive Cache
Reviewed-by: chegar
上级 ad24bc3f
...@@ -36,6 +36,7 @@ import sun.net.www.MeteredStream; ...@@ -36,6 +36,7 @@ import sun.net.www.MeteredStream;
import sun.net.www.ParseUtil; import sun.net.www.ParseUtil;
import sun.net.www.protocol.http.HttpURLConnection; import sun.net.www.protocol.http.HttpURLConnection;
import sun.util.logging.PlatformLogger; import sun.util.logging.PlatformLogger;
import static sun.net.www.protocol.http.HttpURLConnection.TunnelState.*;
/** /**
* @author Herb Jellinek * @author Herb Jellinek
...@@ -276,6 +277,8 @@ public class HttpClient extends NetworkClient { ...@@ -276,6 +277,8 @@ public class HttpClient extends NetworkClient {
ret.cachedHttpClient = true; ret.cachedHttpClient = true;
assert ret.inCache; assert ret.inCache;
ret.inCache = false; ret.inCache = false;
if (httpuc != null && ret.needsTunneling())
httpuc.setTunnelState(TUNNELING);
PlatformLogger logger = HttpURLConnection.getHttpLogger(); PlatformLogger logger = HttpURLConnection.getHttpLogger();
if (logger.isLoggable(PlatformLogger.FINEST)) { if (logger.isLoggable(PlatformLogger.FINEST)) {
logger.finest("KeepAlive stream retrieved from the cache, " + ret); logger.finest("KeepAlive stream retrieved from the cache, " + ret);
......
...@@ -351,7 +351,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { ...@@ -351,7 +351,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
private HttpClient reuseClient = null; private HttpClient reuseClient = null;
/* Tunnel states */ /* Tunnel states */
enum TunnelState { public enum TunnelState {
/* No tunnel */ /* No tunnel */
NONE, NONE,
...@@ -1740,7 +1740,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { ...@@ -1740,7 +1740,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
* *
* @param the state * @param the state
*/ */
void setTunnelState(TunnelState tunnelState) { public void setTunnelState(TunnelState tunnelState) {
this.tunnelState = tunnelState; this.tunnelState = tunnelState;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册