summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-08-26 23:56:49 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-08-26 23:56:49 +0200
commite5e673bafe18032df3b6b7634410a6795e809f2a (patch)
treed10c13cdbab64aca5cf6c879bd9d28f4c10491c3
parent79ed1bc601d20c14d4b514abecdebcf454baf322 (diff)
downloadlibssh-e5e673bafe18032df3b6b7634410a6795e809f2a.tar.gz
libssh-e5e673bafe18032df3b6b7634410a6795e809f2a.tar.xz
libssh-e5e673bafe18032df3b6b7634410a6795e809f2a.zip
auth: Handle request service timeout in blocking mode.
-rw-r--r--src/auth.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/auth.c b/src/auth.c
index 45d6c32..1280c88 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -71,8 +71,13 @@ static int ssh_userauth_request_service(ssh_session session)
do {
rc = ssh_service_request(session,"ssh-userauth");
if (ssh_is_blocking(session)) {
- if(rc == SSH_AGAIN)
- ssh_handle_packets(session, -2);
+ if (rc == SSH_AGAIN) {
+ int err = ssh_handle_packets(session, -2);
+ if (err != SSH_OK) {
+ /* error or timeout */
+ return SSH_ERROR;
+ }
+ }
} else {
/* nonblocking */
ssh_handle_packets(session, 0);