From 4305da29a19446ccd2ab83c6b42cbd037fe377a3 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Sat, 31 Dec 2011 02:15:16 +0100 Subject: session: Cleanup timeout functions. It is possible that we get unrelated packets while waiting for termination, thus waiting indefinitely. As a workaround we have to check the user-supplied timeout. --- src/session.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'src/session.c') diff --git a/src/session.c b/src/session.c index b3ee193..2160ffe 100644 --- a/src/session.c +++ b/src/session.c @@ -306,7 +306,7 @@ static int ssh_flush_termination(void *c){ * @brief Blocking flush of the outgoing buffer * @param[in] session The SSH session * @param[in] timeout Set an upper limit on the time for which this function - * will block, in milliseconds. Specifying a negative value + * will block, in milliseconds. Specifying -1 * means an infinite timeout. This parameter is passed to * the poll() function. * @returns SSH_OK on success, SSH_AGAIN if timeout occurred, @@ -403,17 +403,6 @@ void ssh_set_fd_except(ssh_session session) { ssh_socket_set_except(session->socket); } -static int ssh_make_milliseconds(long sec, long usec) { - int res = usec ? (usec / 1000) : 0; - res += (sec * 1000); - if (res == 0) { - res = 10 * 1000; /* use a reasonable default value in case - * SSH_OPTIONS_TIMEOUT is not set in options. */ - } - - return res; -} - /** * @internal * -- cgit