aboutsummaryrefslogtreecommitdiff
path: root/libssh/options.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-04-02 12:34:55 +0000
committerAndreas Schneider <mail@cynapses.org>2009-04-02 12:34:55 +0000
commit115450ac9bba5edcb2a9d57f01054c7e997fe61c (patch)
treee19fd2532752c54b696fdb5b9b9423774cc1a990 /libssh/options.c
parenteb461d1dbe21f70d9d33b0d21a6af7d6ff9c9a11 (diff)
downloadlibssh-115450ac9bba5edcb2a9d57f01054c7e997fe61c.tar.gz
libssh-115450ac9bba5edcb2a9d57f01054c7e997fe61c.tar.xz
libssh-115450ac9bba5edcb2a9d57f01054c7e997fe61c.zip
Improve ssh_options_set_timeout().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@364 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/options.c')
-rw-r--r--libssh/options.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/libssh/options.c b/libssh/options.c
index 8adcc95..404ccee 100644
--- a/libssh/options.c
+++ b/libssh/options.c
@@ -641,16 +641,29 @@ int ssh_options_set_status_callback(SSH_OPTIONS *opt,
return 0;
}
-/** \bug currently it only timeouts the socket connection, not the
- * complete exchange
- * \brief set a timeout for the connection
- * \param opt options structure
- * \param seconds number of seconds
- * \param usec number of micro seconds
+/**
+ * @brief Set a timeout for the connection.
+ *
+ * @param opt The options structure to use.
+ *
+ * @param seconds Number of seconds.
+ *
+ * @param usec Number of micro seconds.
+ *
+ * @return 0 on success, < 0 on error.
+ *
+ * @bug Currently it only timeouts the socket connection, not the
+ * complete exchange.
*/
-void ssh_options_set_timeout(SSH_OPTIONS *opt, long seconds,long usec){
- opt->timeout=seconds;
- opt->timeout_usec=usec;
+int ssh_options_set_timeout(SSH_OPTIONS *opt, long seconds, long usec) {
+ if (opts == NULL) {
+ return -1;
+ }
+
+ opt->timeout=seconds;
+ opt->timeout_usec=usec;
+
+ return 0;
}
/** Default value is 0 (no connection to SSH1 servers)