]> andersk Git - openssh.git/blobdiff - sshconnect.c
- dtucker@cvs.openbsd.org 2008/06/12 20:38:28
[openssh.git] / sshconnect.c
index 7602da3406b3b8e05fe7c5342c902235b6883d6d..c998742856641754b2e832becbd42791d5b7f44f 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect.c,v 1.206 2008/06/12 00:13:55 grunk Exp $ */
+/* $OpenBSD: sshconnect.c,v 1.207 2008/06/12 20:38:28 dtucker Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -77,23 +77,6 @@ extern pid_t proxy_command_pid;
 static int show_other_keys(const char *, Key *);
 static void warn_changed_key(Key *);
 
-static void
-ms_subtract_diff(struct timeval *start, int *ms)
-{
-       struct timeval diff, finish;
-
-       gettimeofday(&finish, NULL);
-       timersub(&finish, start, &diff);        
-       *ms -= (diff.tv_sec * 1000) + (diff.tv_usec / 1000);
-}
-
-static void
-ms_to_timeval(struct timeval *tv, int ms)
-{
-       tv->tv_sec = ms / 1000;
-       tv->tv_usec = (ms % 1000) * 1000;
-}
-
 /*
  * Connect to the given ssh server using a proxy command.
  */
@@ -178,6 +161,8 @@ ssh_proxy_connect(const char *host, u_short port, const char *proxy_command)
 
        /* Set the connection file descriptors. */
        packet_set_connection(pout[0], pin[1]);
+       packet_set_timeout(options.server_alive_interval,
+           options.server_alive_count_max);
 
        /* Indicate OK return */
        return 0;
@@ -422,6 +407,8 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
 
        /* Set the connection. */
        packet_set_connection(sock, sock);
+       packet_set_timeout(options.server_alive_interval,
+           options.server_alive_count_max);
 
        return 0;
 }
This page took 0.032397 seconds and 4 git commands to generate.