7199219: Proxy-Connection headers set incorrectly when a HttpClient is retrieved from the Keep Alive Cache
Reviewed-by: chegar
--- a/jdk/src/share/classes/sun/net/www/http/HttpClient.java Thu Sep 27 22:35:07 2012 +0100
+++ b/jdk/src/share/classes/sun/net/www/http/HttpClient.java Fri Sep 28 04:39:02 2012 +0100
@@ -36,6 +36,7 @@
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 @@
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);
--- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Thu Sep 27 22:35:07 2012 +0100
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Fri Sep 28 04:39:02 2012 +0100
@@ -351,7 +351,7 @@
private HttpClient reuseClient = null;
/* Tunnel states */
- enum TunnelState {
+ public enum TunnelState {
/* No tunnel */
NONE,
@@ -1740,7 +1740,7 @@
*
* @param the state
*/
- void setTunnelState(TunnelState tunnelState) {
+ public void setTunnelState(TunnelState tunnelState) {
this.tunnelState = tunnelState;
}