diff options
author | rofl0r <retnyg@gmx.net> | 2011-08-05 03:00:21 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-08-07 12:47:09 +0200 |
commit | 61a97ccedef470e587798fee52fb011e8d9c323a (patch) | |
tree | 180a8cb7a5976adb205474c3e9e400b2658d8b7e /src/auth.c | |
parent | a1ef27c0b882d0791ab29584f015d1f8bee44996 (diff) | |
download | libssh-61a97ccedef470e587798fee52fb011e8d9c323a.tar.gz libssh-61a97ccedef470e587798fee52fb011e8d9c323a.tar.xz libssh-61a97ccedef470e587798fee52fb011e8d9c323a.zip |
session: Fix timeout handling.
-2 now means to use the timeout specified in options. It wasn't used
earlier and poll only knows -1 and 0 anyway for special meanings.
(cherry picked from commit af85337f5ff052437fa5cf117f3d065488640660)
Diffstat (limited to 'src/auth.c')
-rw-r--r-- | src/auth.c | 34 |
1 files changed, 17 insertions, 17 deletions
@@ -62,23 +62,23 @@ * again is necessary */ static int ask_userauth(ssh_session session) { - int rc = 0; - - enter_function(); - do { - rc=ssh_service_request(session,"ssh-userauth"); - if(ssh_is_blocking(session)){ - if(rc==SSH_AGAIN) - ssh_handle_packets(session,-1); - } else { - /* nonblocking */ - ssh_handle_packets(session,0); - rc=ssh_service_request(session,"ssh-userauth"); - break; - } - } while(rc==SSH_AGAIN); - leave_function(); - return rc; + int rc = 0; + + enter_function(); + do { + rc = ssh_service_request(session,"ssh-userauth"); + if (ssh_is_blocking(session)) { + if(rc == SSH_AGAIN) + ssh_handle_packets(session, -2); + } else { + /* nonblocking */ + ssh_handle_packets(session, 0); + rc = ssh_service_request(session, "ssh-userauth"); + break; + } + } while (rc == SSH_AGAIN); + leave_function(); + return rc; } /** |