From 66b37c856c29b77ab548063de2fb64a8435e8b9f Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Mon, 11 Feb 2013 21:37:05 +0100 Subject: session: Introduce SSH_TIMEOUT_DEFAULT The default timeout of 30seconds is very nice when connecting to a new SSH session, however it completely breaks the synchronous blocking API. Use SSH_TIMEOUT_DEFAULT when in blocking mode so channel reads&write are blocking as expected Reviewed-by: Andreas Schneider --- include/libssh/session.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/libssh/session.h b/include/libssh/session.h index 18bc41f8..e6bea771 100644 --- a/include/libssh/session.h +++ b/include/libssh/session.h @@ -69,8 +69,13 @@ enum ssh_pending_call_e { #define SSH_SESSION_FLAG_AUTHENTICATED 2 /* codes to use with ssh_handle_packets*() */ +/* Infinite timeout */ #define SSH_TIMEOUT_INFINITE -1 +/* Use the timeout defined by user if any. Mostly used with new connections */ #define SSH_TIMEOUT_USER -2 +/* Use the default timeout, depending on ssh_is_blocking() */ +#define SSH_TIMEOUT_DEFAULT -3 +/* Don't block at all */ #define SSH_TIMEOUT_NONBLOCKING 0 /* members that are common to ssh_session and ssh_bind */ -- cgit v1.2.3