--- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Mon Feb 22 15:27:11 2010 +0000
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Tue Feb 23 17:08:23 2010 +0000
@@ -423,7 +423,7 @@
// Try keep-alive only on first attempt
if (!failedOnce && http.getHttpKeepAliveSet()) {
- if (http.usingProxy) {
+ if (http.usingProxy && tunnelState() != TunnelState.TUNNELING) {
requests.setIfNotSet("Proxy-Connection", "keep-alive");
} else {
requests.setIfNotSet("Connection", "keep-alive");