aboutsummaryrefslogtreecommitdiff
path: root/src/session.c
diff options
context:
space:
mode:
authorrofl0r <retnyg@gmx.net>2011-12-31 02:15:16 +0100
committerAndreas Schneider <asn@cryptomilk.org>2012-01-02 12:39:43 +0100
commit4305da29a19446ccd2ab83c6b42cbd037fe377a3 (patch)
tree1d642f1930c42faeb89734234bf2c1e32b18e464 /src/session.c
parent2f861a858be9f2fe1f55a0fbfc47d732e3b3b31b (diff)
downloadlibssh-4305da29a19446ccd2ab83c6b42cbd037fe377a3.tar.gz
libssh-4305da29a19446ccd2ab83c6b42cbd037fe377a3.tar.xz
libssh-4305da29a19446ccd2ab83c6b42cbd037fe377a3.zip
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.
Diffstat (limited to 'src/session.c')
-rw-r--r--src/session.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/session.c b/src/session.c
index b3ee193e..2160ffea 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
*