mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [mina-sshd] lgoldstein commented on a change in pull request #176: [SSHD-1017] Add support for chacha20-poly1305@openssh.com
Date Mon, 26 Oct 2020 17:06:13 GMT

lgoldstein commented on a change in pull request #176:
URL: https://github.com/apache/mina-sshd/pull/176#discussion_r512126291



##########
File path: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
##########
@@ -1757,14 +1764,18 @@ protected void receiveNewKeys() throws Exception {
                     this, inCipher, outCipher, recommendedByteRekeyBlocks, maxRekeyBlocks);
         }
 
+        resetCounters();
+        lastKeyTimeValue.set(Instant.now());
+        firstKexPacketFollows = null;
+    }
+
+    protected void resetCounters() {
         inBytesCount.set(0L);
         outBytesCount.set(0L);
         inPacketsCount.set(0L);
         outPacketsCount.set(0L);
         inBlocksCount.set(0L);
         outBlocksCount.set(0L);
-        lastKeyTimeValue.set(Instant.now());
-        firstKexPacketFollows = null;

Review comment:
       If it becomes too cumbersome you can use `@SuppressWarnings("checkstyle:...the rule")`
- I do not encourage it, but sometimes it is better than the alternative




----------------------------------------------------------------
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Mime
View raw message