File 4489-ssh-alive-small-fixes.patch of Package erlang
From ce7728f97d41a8c816279ebe0243e5d62253088e Mon Sep 17 00:00:00 2001
From: Alexandre Rodrigues <alexandrejbr@live.com>
Date: Fri, 24 Oct 2025 16:24:45 +0200
Subject: [PATCH 19/20] ssh: alive small fixes
---
lib/ssh/doc/guides/hardening.md | 5 +++++
lib/ssh/src/ssh.hrl | 9 +++++----
lib/ssh/src/ssh_options.erl | 4 ++--
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/lib/ssh/doc/src/hardening.xml b/lib/ssh/doc/src/hardening.xml
index 6af69745b1..4122819469 100644
--- a/lib/ssh/doc/src/hardening.xml
+++ b/lib/ssh/doc/src/hardening.xml
@@ -110,6 +110,12 @@
The timeout is started when the authentication phase is completed.
It defaults to infinity.
</item>
+ <tag><seetype marker="ssh#alive_common_option">alive</seetype></tag>
+ <item>
+ Sets the interval and the maximum number of alive messages that may be sent without
+ receiving any message back. Alive messages are typically used to detect that a connection
+ became unresponsive.
+ </item>
</taglist>
<p>A figure clarifies when a timeout is started and when it triggers:
</p>
diff --git a/lib/ssh/src/ssh_options.erl b/lib/ssh/src/ssh_options.erl
index 902ab0fd7c..d0d73a2f04 100644
--- a/lib/ssh/src/ssh_options.erl
+++ b/lib/ssh/src/ssh_options.erl
@@ -862,9 +862,9 @@ default(common) ->
alive =>
#{default => #{count_max => 3, interval => infinity},
- chk => fun(#{count_max := Count, interval := IntervalSeconds}) ->
+ chk => fun(#{count_max := Count, interval := Interval}) ->
check_pos_integer(Count) andalso
- check_timeout(IntervalSeconds)
+ check_timeout(Interval)
end,
class => user_option
},
--
2.51.0