aboutsummaryrefslogtreecommitdiff
path: root/libssh/auth.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2009-12-26 16:51:33 +0100
committerAris Adamantiadis <aris@0xbadc0de.be>2009-12-26 16:51:33 +0100
commit6f3505bf6b3a747df2f6dec55b29228d1b0a0a4e (patch)
tree41b6d4c7d2dd472808f0c33e2b35d80ba24f286c /libssh/auth.c
parentbfdc48e320143183927933c23f43ff87def798f3 (diff)
downloadlibssh-6f3505bf6b3a747df2f6dec55b29228d1b0a0a4e.tar.gz
libssh-6f3505bf6b3a747df2f6dec55b29228d1b0a0a4e.tar.xz
libssh-6f3505bf6b3a747df2f6dec55b29228d1b0a0a4e.zip
Asynchronous service request
Diffstat (limited to 'libssh/auth.c')
-rw-r--r--libssh/auth.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/libssh/auth.c b/libssh/auth.c
index 9349cc7..409917f 100644
--- a/libssh/auth.c
+++ b/libssh/auth.c
@@ -45,19 +45,23 @@
/** \addtogroup ssh_auth
* @{ */
+/**
+ * @internal
+ * @brief ask access to the ssh-userauth service
+ * @param session SSH session handle
+ * @returns SSH_OK on success
+ * @returns SSH_ERROR on error
+ * @bug current implementation is blocking
+ */
static int ask_userauth(ssh_session session) {
int rc = 0;
enter_function();
-
- if (session->auth_service_asked) {
- rc = 0;
- } else if (ssh_service_request(session,"ssh-userauth")) {
- rc = -1;
- } else {
- session->auth_service_asked++;
- }
-
+ do {
+ rc=ssh_service_request(session,"ssh-userauth");
+ if(rc==SSH_AGAIN)
+ ssh_handle_packets(session);
+ } while(rc==SSH_AGAIN);
leave_function();
return rc;
}