This is an automated email from the ASF dual-hosted git repository. penghui pushed a commit to branch branch-2.8 in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit e690b4c8a21091dd2969b7ff4a62eb3aa6928e28 Author: Lari Hotari <[email protected]> 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 958e5eab9c4..9ffb29c0376 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; @@ -35,7 +36,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()); } /*
