This is an automated email from the ASF dual-hosted git repository.

twolf pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mina-sshd.git

commit 0c2403fda75a479e8f8953fa6cca58ef25e98bfa
Author: Thomas Wolf <tw...@apache.org>
AuthorDate: Mon Jun 3 20:20:34 2024 +0200

    Minor simplification in packet decoding
    
    No need to divide two equal values; just increment the block count.
---
 .../java/org/apache/sshd/common/session/helpers/AbstractSession.java  | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
 
b/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
index 921e28733..4dfb8e620 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
@@ -1589,9 +1589,7 @@ public abstract class AbstractSession extends 
SessionHelper {
                     } else if ((inCipher != null) && (!etmMode)) {
                         // Decrypt the first bytes so we can extract the 
packet length
                         inCipher.update(decoderBuffer.array(), 0, 
inCipherSize);
-
-                        int blocksCount = inCipherSize / 
inCipher.getCipherBlockSize();
-                        inBlocksCount.addAndGet(Math.max(1, blocksCount));
+                        inBlocksCount.incrementAndGet();
                     }
                     // Read packet length
                     decoderLength = decoderBuffer.getInt();

Reply via email to