-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In some environments DNS is not available and is performed by the CONNECT proxy. Nothing "special" should need to be done for these environments, but the previous support took shortcuts which knowingly would not support such environments. This change should fix both OkHttp and Netty. Netty's Bootstrap.connect() resolved the name immediately whereas using ChannelPipeline.connect() waits until the address reaches the end of the pipeline. Netty uses NetUtil.toSocketAddressString() to get the name of the address, which uses InetSocketAddress.getHostString() when available. OkHttp is still using InetSocketAddress.getHostName() which may issue reverse DNS lookups. However, if the reverse DNS lookup fails, it should convert the IP to a textual string like getHostString(). So as long as the reverse DNS maps to the same machine as the IP, there should only be performance concerns, not correctness issues. Since the DnsNameResolver is creating unresolved addresses, the reverse DNS lookups shouldn't occur in the common case.
- Loading branch information
Showing
3 changed files
with
14 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters