Skip to content

Commit 4803ab4

Browse files
n-milesslandelle
authored andcommitted
Stop doing reverse DNS lookups (#1633), close #1632
1 parent 71dad6a commit 4803ab4

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

client/src/main/java/org/asynchttpclient/netty/channel/ChannelManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ public EventLoopGroup getEventLoopGroup() {
481481

482482
public ClientStats getClientStats() {
483483
Map<String, Long> totalConnectionsPerHost = openChannels.stream().map(Channel::remoteAddress).filter(a -> a.getClass() == InetSocketAddress.class)
484-
.map(a -> (InetSocketAddress) a).map(InetSocketAddress::getHostName).collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
484+
.map(a -> (InetSocketAddress) a).map(InetSocketAddress::getHostString).collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
485485
Map<String, Long> idleConnectionsPerHost = channelPool.getIdleChannelCountPerHost();
486486
Map<String, HostStats> statsPerHost = totalConnectionsPerHost.entrySet().stream().collect(Collectors.toMap(Entry::getKey, entry -> {
487487
final long totalConnectionCount = entry.getValue();

client/src/main/java/org/asynchttpclient/netty/channel/DefaultChannelPool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public Map<String, Long> getIdleChannelCountPerHost() {
222222
.map(idle -> idle.getChannel().remoteAddress())
223223
.filter(a -> a.getClass() == InetSocketAddress.class)
224224
.map(a -> (InetSocketAddress) a)
225-
.map(InetSocketAddress::getHostName)
225+
.map(InetSocketAddress::getHostString)
226226
.collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
227227
}
228228

client/src/main/java/org/asynchttpclient/netty/timeout/TimeoutTimerTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void clean() {
5555

5656
void appendRemoteAddress(StringBuilder sb) {
5757
InetSocketAddress remoteAddress = timeoutsHolder.remoteAddress();
58-
sb.append(remoteAddress.getHostName());
58+
sb.append(remoteAddress.getHostString());
5959
if (!remoteAddress.isUnresolved()) {
6060
sb.append('/').append(remoteAddress.getAddress().getHostAddress());
6161
}

client/src/main/java/org/asynchttpclient/resolver/RequestHostnameResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public enum RequestHostnameResolver {
3535

3636
public Future<List<InetSocketAddress>> resolve(NameResolver<InetAddress> nameResolver, InetSocketAddress unresolvedAddress, AsyncHandler<?> asyncHandler) {
3737

38-
final String hostname = unresolvedAddress.getHostName();
38+
final String hostname = unresolvedAddress.getHostString();
3939
final int port = unresolvedAddress.getPort();
4040
final Promise<List<InetSocketAddress>> promise = ImmediateEventExecutor.INSTANCE.newPromise();
4141

client/src/main/java/org/asynchttpclient/util/ProxyUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private static ProxyServerSelector createProxyServerSelector(final ProxySelector
156156
return null;
157157
} else {
158158
InetSocketAddress address = (InetSocketAddress) proxy.address();
159-
return proxyServer(address.getHostName(), address.getPort()).build();
159+
return proxyServer(address.getHostString(), address.getPort()).build();
160160
}
161161
case DIRECT:
162162
return null;

0 commit comments

Comments
 (0)