Bug in LDAPObject.c, l_ldap_result()
Michael Ströder
michael at stroeder.com
Sat Jun 29 19:54:12 CEST 2002
Derrick 'dman' Hudson wrote:
>
> I see now :
>
> def search_st(...)
> - return self.result(msgid,all=1,timeout=timeout)
> + return self.result(msgid,all=1,timeout=timeout)[1]
>
>
> That's precisely what I kept running into
Please test it! This whole stuff with result() is somewhat
incomplete anyway since the result type
> | I guess I will add a derived class for the non-blocking version of
> | LDAPObject.result(). So everyone will be free to choose.
>
> Isn't that what 'timeout=0' is for?
Yes. But then the application has to handle that. The non-blocking
version of LDAPObject.result() is the one which needed the
time.sleep() hack. I will add it to ldapobject.py in a separate class.
> I also think the C function needs
> to be modified to treat Py_None as NULL to allow python code to
> specify a timeout that is indefinitely long.
IMHO that's done with timeout=-1. Looking at l_ldap_result() in
LDAPObject.c it seems to be implemented correctly (although
reading C makes my eyes hurt):
if (timeout >= 0) {
tvp = &tv;
set_timeval_from_double( tvp, timeout );
} else {
tvp = NULL;
}
Ciao, Michael.
More information about the python-ldap
mailing list