RE: timeout on ldap_simple_bind_s()
"Xu, Qiang (FXSGSC)" <[email protected]> Fri, 11 Sep 2009 17:05:44 +0800
| Newsgroups | gmane.comp.mozilla.devel.directory |
|---|---|
| Message-ID | <D8C9BC7FFCF8154FB7141EB8DB609C172F0C10583E@SGPAPHQ-EXSCC01.dc01.fujixerox.net> |
More debug code is added to the wrapper:
=======================================
static int ldap_simple_bind_ext_s( LDAP *ld, const char *dn, const char *passwd, struct timeval *timeout )
{
int msgid;
LDAPMessage *result;
LOGINFO("debug ldap_simple_bind_ext_s timeout = %d ", timeout->tv_sec );
if ( ld == NULL ) {
return( LDAP_PARAM_ERROR );
}
LOGINFO("debug ldap_simple_bind_ext_s --1" );
if ( (msgid = ldap_simple_bind( ld, dn, passwd )) == -1 )
return( ldap_get_lderrno( ld, NULL, NULL ) );
LOGINFO("debug ldap_simple_bind_ext_s --2 ");
if ( ldap_result( ld, msgid, 1, timeout, &result ) == -1 )
return( ldap_get_lderrno( ld, NULL, NULL ) );
LOGINFO("debug ldap_simple_bind_ext_s --3" );
return( ldap_result2error( ld, result, 1 ) );
}
=======================================
Just want to get a better understanding of the process.
The log is quite confusing:
=======================================
<distribution> (Fri Sep 11 2009 16:49:07.584) <p13664,t813147760,aba_ldap_interface.c,1394>
INFO>> Secure Login
<distribution> (Fri Sep 11 2009 16:49:07.584) <p13664,t813147760,aba_ldap_interface.c,5884>
INFO>> debug ldap_simple_bind_ext_s timeout = 10
<distribution> (Fri Sep 11 2009 16:49:07.584) <p13664,t813147760,aba_ldap_interface.c,5888>
INFO>> debug ldap_simple_bind_ext_s --1
=======================================
It seems ldap_result() was not called. Isn't ldap_simple_bind() async func? Why does it behave like the sync one ldap_simple_bind_s()?
Thanks,
Xu Qiang