[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/2] session: ssh_handle_packets_termination() SSH_AGAIN bug fix
[Thread Prev] | [Thread Next]
- Subject: [PATCH 2/2] session: ssh_handle_packets_termination() SSH_AGAIN bug fix
- From: Nicolas Viennot <nicolas@xxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Mon, 10 Jun 2013 04:40:46 -0400
- To: libssh@xxxxxxxxxx
- Cc: Nicolas Viennot <nicolas@xxxxxxxxxxx>
ssh_handle_packets_termination() must not return SSH_OK when exiting due to
a timeout while the termination function still returns 1.
Signed-off-by: Nicolas Viennot <nicolas@xxxxxxxxxxx>
---
src/session.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/session.c b/src/session.c
index 4e71394..fe5d897 100644
--- a/src/session.c
+++ b/src/session.c
@@ -537,8 +537,10 @@ int ssh_handle_packets_termination(ssh_session session, int timeout,
ret = ssh_handle_packets(session, tm);
if(ret == SSH_ERROR)
break;
- if(ssh_timeout_elapsed(&ts,timeout))
+ if(ssh_timeout_elapsed(&ts,timeout)) {
+ ret = fct(user) ? SSH_OK : SSH_AGAIN;
break;
+ }
tm = ssh_timeout_update(&ts, timeout);
}
return ret;
--
1.8.2.1
| [PATCH 1/2] channels: allow channel_open() to return SSH_AGAIN | Nicolas Viennot <nicolas@xxxxxxxxxxx> |