diff options
Diffstat (limited to 'sshconnect.c')
-rw-r--r-- | sshconnect.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/sshconnect.c b/sshconnect.c index 7602da340..c99874285 100644 --- a/sshconnect.c +++ b/sshconnect.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshconnect.c,v 1.206 2008/06/12 00:13:55 grunk Exp $ */ | 1 | /* $OpenBSD: sshconnect.c,v 1.207 2008/06/12 20:38:28 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -77,23 +77,6 @@ extern pid_t proxy_command_pid; | |||
77 | static int show_other_keys(const char *, Key *); | 77 | static int show_other_keys(const char *, Key *); |
78 | static void warn_changed_key(Key *); | 78 | static void warn_changed_key(Key *); |
79 | 79 | ||
80 | static void | ||
81 | ms_subtract_diff(struct timeval *start, int *ms) | ||
82 | { | ||
83 | struct timeval diff, finish; | ||
84 | |||
85 | gettimeofday(&finish, NULL); | ||
86 | timersub(&finish, start, &diff); | ||
87 | *ms -= (diff.tv_sec * 1000) + (diff.tv_usec / 1000); | ||
88 | } | ||
89 | |||
90 | static void | ||
91 | ms_to_timeval(struct timeval *tv, int ms) | ||
92 | { | ||
93 | tv->tv_sec = ms / 1000; | ||
94 | tv->tv_usec = (ms % 1000) * 1000; | ||
95 | } | ||
96 | |||
97 | /* | 80 | /* |
98 | * Connect to the given ssh server using a proxy command. | 81 | * Connect to the given ssh server using a proxy command. |
99 | */ | 82 | */ |
@@ -178,6 +161,8 @@ ssh_proxy_connect(const char *host, u_short port, const char *proxy_command) | |||
178 | 161 | ||
179 | /* Set the connection file descriptors. */ | 162 | /* Set the connection file descriptors. */ |
180 | packet_set_connection(pout[0], pin[1]); | 163 | packet_set_connection(pout[0], pin[1]); |
164 | packet_set_timeout(options.server_alive_interval, | ||
165 | options.server_alive_count_max); | ||
181 | 166 | ||
182 | /* Indicate OK return */ | 167 | /* Indicate OK return */ |
183 | return 0; | 168 | return 0; |
@@ -422,6 +407,8 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr, | |||
422 | 407 | ||
423 | /* Set the connection. */ | 408 | /* Set the connection. */ |
424 | packet_set_connection(sock, sock); | 409 | packet_set_connection(sock, sock); |
410 | packet_set_timeout(options.server_alive_interval, | ||
411 | options.server_alive_count_max); | ||
425 | 412 | ||
426 | return 0; | 413 | return 0; |
427 | } | 414 | } |