mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-06 18:29:50 +09:00
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 af85337f5f)
This commit is contained in:
committed by
Andreas Schneider
parent
a1ef27c0b8
commit
61a97ccede
32
src/auth.c
32
src/auth.c
@@ -62,23 +62,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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user