Skip to content

Commit

Permalink
[fix][client] Prevent DNS reverse lookup when physical address is an …
Browse files Browse the repository at this point in the history
…IP address (#19028)

(cherry picked from commit d8569cd)
  • Loading branch information
lhotari authored and michaeljmarshall committed Jan 31, 2023
1 parent 4ac2419 commit 80bb1b7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public void failure(Throwable failure) {
private URI replaceWithNew(InetSocketAddress address, URI uri) {
String originalUri = uri.toString();
String newUri = (originalUri.split(":")[0] + "://")
+ address.getHostName() + ":"
+ address.getHostString() + ":"
+ address.getPort()
+ uri.getRawPath();
if (uri.getRawQuery() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private CompletableFuture<ClientCnx> createConnection(InetSocketAddress logicalA
cnx.setTargetBroker(logicalAddress);
}

cnx.setRemoteHostName(physicalAddress.getHostName());
cnx.setRemoteHostName(physicalAddress.getHostString());

cnx.connectionFuture().thenRun(() -> {
if (log.isDebugEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public InetSocketAddress resolveHost() {
@Override
public URI resolveHostUri() {
InetSocketAddress host = resolveHost();
String hostUrl = serviceUri.getServiceScheme() + "://" + host.getHostName() + ":" + host.getPort();
String hostUrl = serviceUri.getServiceScheme() + "://" + host.getHostString() + ":" + host.getPort();
return URI.create(hostUrl);
}

Expand Down

0 comments on commit 80bb1b7

Please sign in to comment.