You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2022/04/20 08:54:57 UTC
[pulsar] branch master updated: Improve skipping of DNS resolution when creating AuthenticationDataHttp instance (#15228)
This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new e71b98ae157 Improve skipping of DNS resolution when creating AuthenticationDataHttp instance (#15228)
e71b98ae157 is described below
commit e71b98ae157c4c108802661eaa72913e9c9e0bef
Author: Lari Hotari <lh...@users.noreply.github.com>
AuthorDate: Wed Apr 20 11:54:51 2022 +0300
Improve skipping of DNS resolution when creating AuthenticationDataHttp instance (#15228)
- improves solution added in #15221
- It's better to use the JDK provided InetSocketAddress.createUnresolved method
to prevent unnecessary DNS resolution
---
.../apache/pulsar/broker/authentication/AuthenticationDataHttp.java | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationDataHttp.java b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationDataHttp.java
index 75a75225576..f48dbc263e0 100644
--- a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationDataHttp.java
+++ b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationDataHttp.java
@@ -18,7 +18,6 @@
*/
package org.apache.pulsar.broker.authentication;
-import io.netty.util.NetUtil;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import javax.servlet.http.HttpServletRequest;
@@ -35,9 +34,7 @@ public class AuthenticationDataHttp implements AuthenticationDataSource {
throw new IllegalArgumentException();
}
this.request = request;
- this.remoteAddress =
- new InetSocketAddress(NetUtil.createInetAddressFromIpAddressString(request.getRemoteAddr()),
- request.getRemotePort());
+ this.remoteAddress = InetSocketAddress.createUnresolved(request.getRemoteAddr(), request.getRemotePort());
}
/*