How to get msgid from ldap.result() call?

Michael Ströder michael at
Tue May 4 09:03:16 CEST 2004

Ken Key wrote:
>     when calling ldap.result(msgid=ldap.RES_ANY) on several
> outstanding async client requests in python-ldap 2.0.0pre21, I
> cannot find a way to get the received message ID.

In current implementation the msgid is not passed to the calling application.

>  In looking
> through the sources, it appears the information is never preserved.
> I locally hacked my copy of LDAPObject.c to make ldap.result()
> return a 3-part tuple of (result_type, result_data, result_msgid),
> where result_msgid = ldap_msgid(msg) after the msg was determined
> to be good.

Please provide a patch.

>  I need the message ID to match up the reply with the
> originating request context.

This would also be very handy for a completely async LDAPObject 
implementation which dispatches results to calling threads without having to 
use thread locks around each _ldap call.

Ciao, Michael.

More information about the python-ldap mailing list