tomaswolf commented on code in PR #507:
URL: https://github.com/apache/mina-sshd/pull/507#discussion_r1617834559
##########
sshd-core/src/main/java/org/apache/sshd/client/session/ClientConnectionService.java:
##########
@@ -55,7 +61,40 @@ public ClientConnectionService(AbstractClientSession s)
throws SshException {
heartbeatRequest =
CoreModuleProperties.HEARTBEAT_REQUEST.getRequired(this);
heartbeatInterval =
CoreModuleProperties.HEARTBEAT_INTERVAL.getRequired(this);
- heartbeatReplyMaxWait =
CoreModuleProperties.HEARTBEAT_REPLY_WAIT.getRequired(this);
+ heartbeatMaxNoReply = configureMaxNoReply();
+ }
+
+ protected int configureMaxNoReply() {
+ @SuppressWarnings("deprecation")
+ Duration timeout =
CoreModuleProperties.HEARTBEAT_REPLY_WAIT.getOrNull(this);
+ if (timeout == null ||
GenericUtils.isNegativeOrNull(heartbeatInterval) ||
GenericUtils.isEmpty(heartbeatRequest)) {
+ return
CoreModuleProperties.HEARTBEAT_NO_REPLY_MAX.getRequired(this).intValue();
+ }
+ // The deprecated timeout is configured explicitly. If the new no
reply max is _not_ explicitly configured,
Review Comment:
Done.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]