[JDK 10] RFR: 8185852: HttpConnection should resolve addresses before SocketChannel.connect() is called

Daniel Fuchs daniel.fuchs at oracle.com
Fri Aug 4 17:14:58 UTC 2017


Hi,

Please find below a small fix for
8185852: HttpConnection should resolve addresses before 
SocketChannel.connect() is called
https://bugs.openjdk.java.net/browse/JDK-8185852

http://cr.openjdk.java.net/~dfuchs/webrev_8185852/webrev.00/

The issue here is that ProxySelector.getDefault() may return
java.net.Proxy instances whose SocketAddress are unresolved.

We need to attempt address resolution before calling
SocketChannel.connect, otherwise a 
java.nio.channels.UnresolvedAddressException
is raised.

Rather than using ProxySelector.getDefault() the test forces
the creation of a ProxySelector from an unresolved address.
Fails without the fix and passes with it.

The legacy HTTP stack is used before the real test to verify
that all communication channels are working (would detect test
bugs).

best regards,

-- daniel


More information about the net-dev mailing list