thc202 commented on code in PR #598:
URL: 
https://github.com/apache/httpcomponents-client/pull/598#discussion_r1841994505


##########
httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/DefaultHttpClientConnectionOperator.java:
##########
@@ -153,43 +153,50 @@ public void connect(
             final Timeout connectTimeout,
             final SocketConfig socketConfig,
             final Object attachment,
-            final HttpContext context) throws IOException {
+            final HttpContext context,

Review Comment:
   It would be a lot more flexible if this could be configured through the 
context (that's what we did to this forked class).



##########
httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/DefaultHttpClientConnectionOperator.java:
##########
@@ -153,43 +153,50 @@ public void connect(
             final Timeout connectTimeout,
             final SocketConfig socketConfig,
             final Object attachment,
-            final HttpContext context) throws IOException {
+            final HttpContext context,
+            final boolean disableDnsResolution) throws IOException {
         Args.notNull(conn, "Connection");
         Args.notNull(endpointHost, "Host");
         Args.notNull(socketConfig, "Socket config");
         Args.notNull(context, "Context");
-        final InetAddress[] remoteAddresses;
-        if (endpointHost.getAddress() != null) {
-            remoteAddresses = new InetAddress[] { endpointHost.getAddress() };
-        } else {
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("{} resolving remote address", 
endpointHost.getHostName());
-            }
 
-            remoteAddresses = 
this.dnsResolver.resolve(endpointHost.getHostName());
+        final Timeout soTimeout = socketConfig.getSoTimeout();
+        final SocketAddress socksProxyAddress = 
socketConfig.getSocksProxyAddress();
+        final Proxy socksProxy = socksProxyAddress != null ? new 
Proxy(Proxy.Type.SOCKS, socksProxyAddress) : null;
+        final int port = 
this.schemePortResolver.resolve(endpointHost.getSchemeName(), endpointHost);
+        final InetSocketAddress[] remoteAddresses;
 
+        if (disableDnsResolution) {
+            // Hostname is an .onion address. Do not try to resolve it to an 
InetAddress.

Review Comment:
   Or not, it's not determining what the address is.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to