AndrewJSchofield commented on code in PR #15190:
URL: https://github.com/apache/kafka/pull/15190#discussion_r1453668720


##########
clients/src/main/java/org/apache/kafka/common/network/KafkaChannel.java:
##########
@@ -369,6 +369,16 @@ public InetAddress socketAddress() {
         return transportLayer.socketChannel().socket().getInetAddress();
     }
 
+    /**
+     * Returns the port to which this channel's socket is connected or `null` 
if the socket has never been connected.

Review Comment:
   nit: This cannot return `null` if the socket has never been connected.



##########
clients/src/main/java/org/apache/kafka/common/security/authenticator/SaslServerAuthenticator.java:
##########
@@ -433,7 +437,7 @@ private void handleSaslToken(byte[] clientToken) throws 
IOException {
             RequestHeader header = RequestHeader.parse(requestBuffer);
             ApiKeys apiKey = header.apiKey();
             short version = header.apiVersion();
-            RequestContext requestContext = new RequestContext(header, 
connectionId, clientAddress(),
+            RequestContext requestContext = new RequestContext(header, 
connectionId, clientAddress(), Optional.of(clientPort()),

Review Comment:
   I'm not quite sure the optionality is right here. Shouldn't there be the 
option of `Optional.empty()` if there's no data?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to