rajinisivaram commented on code in PR #14445: URL: https://github.com/apache/kafka/pull/14445#discussion_r1336233705
########## clients/src/main/java/org/apache/kafka/common/security/ssl/SslFactory.java: ########## @@ -419,15 +419,15 @@ void handshake(SslEngineValidator peerValidator) throws SSLException { while (true) { switch (handshakeStatus) { case NEED_WRAP: - if (netBuffer.position() != 0) // Wait for peer to consume previously wrapped data - return; handshakeResult = sslEngine.wrap(EMPTY_BUF, netBuffer); switch (handshakeResult.getStatus()) { case OK: break; case BUFFER_OVERFLOW: netBuffer.compact(); netBuffer = Utils.ensureCapacity(netBuffer, sslEngine.getSession().getPacketBufferSize()); netBuffer.flip(); + if (netBuffer.position() != 0) // Wait for peer to consume previously wrapped data Review Comment: I think we can do this return at the start of `case BUFFER_OVERFLOW` since we don't need to expand the buffer at this time (we are waiting for peer to consume the data in the buffer by returning). -- 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