src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java

Print this page

        

*** 247,256 **** --- 247,258 ---- /* Set if the user is manually setting the Authorization or Proxy-Authorization headers */ boolean isUserServerAuth; boolean isUserProxyAuth; + String serverAuthKey, proxyAuthKey; + /* Progress source */ protected ProgressSource pi; /* all the response headers we get back */ private MessageHeader responses;
*** 1501,1515 **** (cl > 0 || (te != null && te.equalsIgnoreCase("chunked")))) { errorStream = ErrorStream.getErrorStream(inputStream, cl, http); } throw e; } finally { ! if (respCode == HTTP_PROXY_AUTH && proxyAuthentication != null) { ! proxyAuthentication.endAuthRequest(); } ! else if (respCode == HTTP_UNAUTHORIZED && serverAuthentication != null) { ! serverAuthentication.endAuthRequest(); } } } /* --- 1503,1517 ---- (cl > 0 || (te != null && te.equalsIgnoreCase("chunked")))) { errorStream = ErrorStream.getErrorStream(inputStream, cl, http); } throw e; } finally { ! if (proxyAuthKey != null) { ! AuthenticationInfo.endAuthRequest(proxyAuthKey); } ! if (serverAuthKey != null) { ! AuthenticationInfo.endAuthRequest(serverAuthKey); } } } /*
*** 1718,1729 **** throw new IOException("Unable to tunnel through proxy."+ " Proxy returns \"" + statusLine + "\""); } } finally { ! if (respCode == HTTP_PROXY_AUTH && proxyAuthentication != null) { ! proxyAuthentication.endAuthRequest(); } } // restore original request headers requests = savedRequests; --- 1720,1731 ---- throw new IOException("Unable to tunnel through proxy."+ " Proxy returns \"" + statusLine + "\""); } } finally { ! if (proxyAuthKey != null) { ! AuthenticationInfo.endAuthRequest(proxyAuthKey); } } // restore original request headers requests = savedRequests;
*** 1835,1848 **** doingNTLMp2ndStage = true; } if (realm == null) realm = ""; ! ret = AuthenticationInfo.getProxyAuth(host, ! port, ! realm, ! authScheme); if (ret == null) { switch (authScheme) { case BASIC: InetAddress addr = null; try { --- 1837,1848 ---- doingNTLMp2ndStage = true; } if (realm == null) realm = ""; ! proxyAuthKey = AuthenticationInfo.getProxyAuthKey(host, port, realm, authScheme); ! ret = AuthenticationInfo.getProxyAuth(proxyAuthKey); if (ret == null) { switch (authScheme) { case BASIC: InetAddress addr = null; try {
*** 1979,1989 **** } domain = p.findValue ("domain"); if (realm == null) realm = ""; ! ret = AuthenticationInfo.getServerAuth(url, realm, authScheme); InetAddress addr = null; if (ret == null) { try { addr = InetAddress.getByName(url.getHost()); } catch (java.net.UnknownHostException ignored) { --- 1979,1990 ---- } domain = p.findValue ("domain"); if (realm == null) realm = ""; ! serverAuthKey = AuthenticationInfo.getServerAuthKey(url, realm, authScheme); ! ret = AuthenticationInfo.getServerAuth(serverAuthKey); InetAddress addr = null; if (ret == null) { try { addr = InetAddress.getByName(url.getHost()); } catch (java.net.UnknownHostException ignored) {