7199219: Proxy-Connection headers set incorrectly when a HttpClient is retrieved from the Keep Alive Cache
authorrobm
Fri, 28 Sep 2012 04:39:02 +0100
changeset 14008 b572c1f3a7ad
parent 14007 2fde9d6d874a
child 14009 21856a20cc1d
7199219: Proxy-Connection headers set incorrectly when a HttpClient is retrieved from the Keep Alive Cache Reviewed-by: chegar
jdk/src/share/classes/sun/net/www/http/HttpClient.java
jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
--- 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;
     }