summaryrefslogtreecommitdiffstats
path: root/src/auth.c
diff options
context:
space:
mode:
authorrofl0r <retnyg@gmx.net>2011-08-05 03:00:21 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-08-06 11:12:02 +0200
commitaf85337f5ff052437fa5cf117f3d065488640660 (patch)
treeb289a89b4f032b9be811d75a321fef28c29ba0d9 /src/auth.c
parent563fbe4de8ee090b40b50415a86f9a3da16f46b0 (diff)
downloadlibssh-af85337f5ff052437fa5cf117f3d065488640660.tar.gz
libssh-af85337f5ff052437fa5cf117f3d065488640660.tar.xz
libssh-af85337f5ff052437fa5cf117f3d065488640660.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.
Diffstat (limited to 'src/auth.c')
-rw-r--r--src/auth.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/auth.c b/src/auth.c
index 4e08c3e..7122a57 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -63,23 +63,23 @@
* again is necessary
*/
static int ask_userauth(ssh_session session) {
- int rc = 0;
+ 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;
+ 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;
}
/**