ssh: Add #:connection-timeout parameter to 'open-ssh-session'.
* guix/ssh.scm (open-ssh-session): Add #:connection-timeout parameter and honor it.
parent
7046e77721
commit
3d0749b4e3
10
guix/ssh.scm
10
guix/ssh.scm
|
@ -102,7 +102,8 @@ actual key does not match."
|
||||||
(define* (open-ssh-session host #:key user port identity
|
(define* (open-ssh-session host #:key user port identity
|
||||||
host-key
|
host-key
|
||||||
(compression %compression)
|
(compression %compression)
|
||||||
(timeout 3600))
|
(timeout 3600)
|
||||||
|
(connection-timeout 10))
|
||||||
"Open an SSH session for HOST and return it. IDENTITY specifies the file
|
"Open an SSH session for HOST and return it. IDENTITY specifies the file
|
||||||
name of a private key to use for authenticating with the host. When USER,
|
name of a private key to use for authenticating with the host. When USER,
|
||||||
PORT, or IDENTITY are #f, use default values or whatever '~/.ssh/config'
|
PORT, or IDENTITY are #f, use default values or whatever '~/.ssh/config'
|
||||||
|
@ -112,15 +113,16 @@ When HOST-KEY is true, it must be a string like \"ssh-ed25519 AAAAC3Nz…
|
||||||
root@example.org\"; the server is authenticated and an error is raised if its
|
root@example.org\"; the server is authenticated and an error is raised if its
|
||||||
host key is different from HOST-KEY.
|
host key is different from HOST-KEY.
|
||||||
|
|
||||||
Install TIMEOUT as the maximum time in seconds after which a read or write
|
Error out if connection establishment takes more than CONNECTION-TIMEOUT
|
||||||
operation on a channel of the returned session is considered as failing.
|
seconds. Install TIMEOUT as the maximum time in seconds after which a read or
|
||||||
|
write operation on a channel of the returned session is considered as failing.
|
||||||
|
|
||||||
Throw an error on failure."
|
Throw an error on failure."
|
||||||
(let ((session (make-session #:user user
|
(let ((session (make-session #:user user
|
||||||
#:identity identity
|
#:identity identity
|
||||||
#:host host
|
#:host host
|
||||||
#:port port
|
#:port port
|
||||||
#:timeout 10 ;seconds
|
#:timeout connection-timeout
|
||||||
;; #:log-verbosity 'protocol
|
;; #:log-verbosity 'protocol
|
||||||
|
|
||||||
;; Prevent libssh from reading
|
;; Prevent libssh from reading
|
||||||
|
|
Reference in New Issue