diff options
Diffstat (limited to 'ssh.c')
-rw-r--r-- | ssh.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.594 2023/09/03 23:59:32 djm Exp $ */ +/* $OpenBSD: ssh.c,v 1.595 2023/10/11 22:42:26 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -1573,6 +1573,20 @@ main(int ac, char **av) else timeout_ms = options.connection_timeout * 1000; + /* Apply channels timeouts, if set */ + channel_clear_timeouts(ssh); + for (j = 0; j < options.num_channel_timeouts; j++) { + debug3("applying channel timeout %s", + options.channel_timeouts[j]); + if (parse_pattern_interval(options.channel_timeouts[j], + &cp, &i) != 0) { + fatal_f("internal error: bad timeout %s", + options.channel_timeouts[j]); + } + channel_add_timeout(ssh, cp, i); + free(cp); + } + /* Open a connection to the remote host. */ if (ssh_connect(ssh, host, options.host_arg, addrs, &hostaddr, options.port, options.connection_attempts, |