From 2afa5b2dc26a7aab3764140195c209c34d4eea96 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 17 Jul 2010 19:20:20 +0200 Subject: [PATCH] _libssh2_wait_socket: poll needs milliseconds As reported on the mailing list, the code path using poll() should multiple seconds with 1000 to get milliseconds, not divide! Reported by: Jan Van Boghout --- src/session.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/session.c b/src/session.c index f904366..6234ee1 100644 --- a/src/session.c +++ b/src/session.c @@ -564,7 +564,8 @@ int _libssh2_wait_socket(LIBSSH2_SESSION *session) if(dir & LIBSSH2_SESSION_BLOCK_OUTBOUND) sockets[0].events |= POLLOUT; - rc = poll(sockets, 1, seconds_to_next ? seconds_to_next / 1000 : -1); + rc = poll(sockets, 1, seconds_to_next ? + seconds_to_next * 1000 : -1); #else fd_set rfd; fd_set wfd;