changeset 5365:4f7ab66878aa

7199219: Proxy-Connection headers set incorrectly when a HttpClient is retrieved from the Keep Alive Cache Reviewed-by: chegar
author robm
date Fri, 28 Sep 2012 04:39:02 +0100
parents e6dc1d9bc70b
children 8fab77c17bfb
files src/share/classes/sun/net/www/http/HttpClient.java src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/net/www/http/HttpClient.java	Thu Sep 27 22:35:07 2012 +0100
+++ b/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/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Thu Sep 27 22:35:07 2012 +0100
+++ b/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Fri Sep 28 04:39:02 2012 +0100
@@ -349,7 +349,7 @@
     private HttpClient reuseClient = null;
 
     /* Tunnel states */
-    enum TunnelState {
+    public enum TunnelState {
         /* No tunnel */
         NONE,
 
@@ -1739,7 +1739,7 @@
      *
      * @param  the state
      */
-    void setTunnelState(TunnelState tunnelState) {
+    public void setTunnelState(TunnelState tunnelState) {
         this.tunnelState = tunnelState;
     }