This is an automated email from the ASF dual-hosted git repository.
elecharny pushed a commit to branch 2.1.X
in repository https://gitbox.apache.org/repos/asf/mina.git
The following commit(s) were added to refs/heads/2.1.X by this push:
new 3b0f12b Avoided a useless round trip into the SslEngine unwrap if the
input buffer is empty
3b0f12b is described below
commit 3b0f12bc5afe1966fcc72135ab3549f77c80bc33
Author: emmanuel lecharny <[email protected]>
AuthorDate: Fri Jan 14 17:41:22 2022 +0100
Avoided a useless round trip into the SslEngine unwrap if the input buffer
is empty
---
mina-core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/mina-core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java
b/mina-core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java
index f5fc0a4..959984d 100644
--- a/mina-core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java
+++ b/mina-core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java
@@ -792,6 +792,11 @@ class SslHandler {
appBuffer.expand(newCapacity);
continue;
}
+
+ if ( inNetBuffer.position() == inNetBuffer.limit()) {
+ // Nothing more in the incoming data, let's get out
+ break;
+ }
} while (((status == SSLEngineResult.Status.OK) || (status ==
SSLEngineResult.Status.BUFFER_OVERFLOW))
&& ((localHandshakeStatus ==
SSLEngineResult.HandshakeStatus.NOT_HANDSHAKING) ||
(localHandshakeStatus ==
SSLEngineResult.HandshakeStatus.NEED_UNWRAP)));