aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2013-02-11 21:37:05 +0100
committerAndreas Schneider <asn@cryptomilk.org>2013-07-13 14:03:42 +0200
commit66b37c856c29b77ab548063de2fb64a8435e8b9f (patch)
tree56ef36772657682ab74df2d188584f1da74ca6ae /include
parent6bc64c368d49d2c775fa4a0e94dc65fcee746710 (diff)
downloadlibssh-66b37c856c29b77ab548063de2fb64a8435e8b9f.tar.gz
libssh-66b37c856c29b77ab548063de2fb64a8435e8b9f.tar.xz
libssh-66b37c856c29b77ab548063de2fb64a8435e8b9f.zip
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 <asn@cryptomilk.org>
Diffstat (limited to 'include')
-rw-r--r--include/libssh/session.h5
1 files changed, 5 insertions, 0 deletions
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 */