You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by ji...@apache.org on 2022/07/29 11:55:06 UTC
[pulsar] 01/02: Skip unnecessary DNS resolution when creating AuthenticationDataHttp instance (#15221)
This is an automated email from the ASF dual-hosted git repository.
jianghaiting pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit 8994288467979ba0c558a58f1b6d3876effcc77d
Author: Lari Hotari <lh...@users.noreply.github.com>
AuthorDate: Wed Apr 20 06:08:36 2022 +0300
Skip unnecessary DNS resolution when creating AuthenticationDataHttp instance (#15221)
(cherry picked from commit 14991c93533927c35dd3cba74fe52ba3d57f244b)
---
.../apache/pulsar/broker/authentication/AuthenticationDataHttp.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
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 a990b9e0a06..a0f81832af7 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,6 +18,7 @@
*/
package org.apache.pulsar.broker.authentication;
+import io.netty.util.NetUtil;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
@@ -33,7 +34,9 @@ public class AuthenticationDataHttp implements AuthenticationDataSource {
throw new IllegalArgumentException();
}
this.request = request;
- this.remoteAddress = new InetSocketAddress(request.getRemoteAddr(), request.getRemotePort());
+ this.remoteAddress =
+ new InetSocketAddress(NetUtil.createInetAddressFromIpAddressString(request.getRemoteAddr()),
+ request.getRemotePort());
}
/*