JDK-2141997 : Socket creation on Windows takes a long time if web proxy does not have a DNS entry
  • Type: Backport
  • Backport of: JDK-6469803
  • Component: core-libs
  • Sub-Component: java.net
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2006-09-13
  • Updated: 2011-02-16
  • Resolved: 2006-12-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other JDK 7
5.0u11 b02Fixed 7Fixed
Comments
SUGGESTED FIX --- src/share/classes/sun/net/www/http/HttpClient.java- Tue Oct 10 15:49:40 2006 +++ src/share/classes/sun/net/www/http/HttpClient.java Mon Oct 9 17:13:16 2006 @@ -425,11 +425,26 @@ { try { java.security.AccessController.doPrivileged( new java.security.PrivilegedExceptionAction() { public Object run() throws IOException { - openServer(server.getHostName(), server.getPort()); + String s = null; + if (server.isUnresolved()) { + s = server.getHostName(); + } else { + // Use getAddress().toString() to avoid reverse lookup + s = server.getAddress().toString(); + int pos = s.indexOf('/'); + if (pos == 0) { + // extract the IP litteral + s = s.substring(1); + } else { + // extract the hostname + s = s.substring(0, pos); + } + } + openServer(s, server.getPort()); return null; } }); } catch (java.security.PrivilegedActionException pae) { throw (IOException) pae.getException();
20-11-2006

EVALUATION See evaluation for the parent CR.
20-11-2006