diff options
author | Simo Sorce <ssorce@redhat.com> | 2009-07-20 09:25:51 -0400 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2009-07-20 14:37:35 -0400 |
commit | 6b13328dbf1b82b23993c1828c08fbd3757cb39c (patch) | |
tree | 025531a34c21f8a2575fca515b39f499d008485a /server/providers/ldap/sdap.h | |
parent | e64a022ed275bdb747dcac55863d0d39c068849f (diff) | |
download | sssd-6b13328dbf1b82b23993c1828c08fbd3757cb39c.tar.gz sssd-6b13328dbf1b82b23993c1828c08fbd3757cb39c.tar.bz2 sssd-6b13328dbf1b82b23993c1828c08fbd3757cb39c.zip |
Rework the engine that deals with openldap libraries
The way openldap libraries work, require to have a single engine per
connection as all replies are read at the same time. So we need to
always read anything that comes in from the wire and then loop to
dispatch results to the requests that are waiting.
Diffstat (limited to 'server/providers/ldap/sdap.h')
-rw-r--r-- | server/providers/ldap/sdap.h | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/server/providers/ldap/sdap.h b/server/providers/ldap/sdap.h index 85b17515..8466473e 100644 --- a/server/providers/ldap/sdap.h +++ b/server/providers/ldap/sdap.h @@ -23,10 +23,32 @@ #include "db/sysdb.h" #include <ldap.h> +struct sdap_msg { + LDAPMessage *msg; +}; + +typedef void (sdap_op_callback_t)(void *, int, struct sdap_msg *); + +struct sdap_handle; + +struct sdap_op { + struct sdap_op *prev, *next; + struct sdap_handle *sh; + + int msgid; + bool done; + + sdap_op_callback_t *callback; + void *data; +}; + struct sdap_handle { LDAP *ldap; bool connected; - int fd; + + struct tevent_fd *fde; + + struct sdap_op *ops; }; enum sdap_result { @@ -39,10 +61,6 @@ enum sdap_result { SDAP_AUTH_FAILED }; -struct sdap_msg { - LDAPMessage *msg; -}; - #define SDAP_URI 0 #define SDAP_DEFAULT_BIND_DN 1 #define SDAP_DEFAULT_AUTHTOK_TYPE 2 |