-----Original Message----- From: Howard Chu [mailto:hyc@symas.com] Sent: Friday, January 28, 2011 1:20 AM
- has anything been added in more recent versions that will help with
this?
Yes, look at LDAP_OPT_CONNECT_CB in 2.4. You can set a callback that is invoked right after a connection is opened and right after it's closed. Your callback function gets the sockbuf as one of the parameters.
Thanks Howard,
I'm looking at upgrading our OpenLDAP port to 2.4.23 so I can make use of this, but in doing it I think I spotted a bug with this new callback.
In function ldap_connect_to_host are two calls to . The first for "#if defined( HAVE_GETADDRINFO ) && defined( HAVE_INET_NTOP )" looks OK, but the 2nd for the #else case of that is this:
i = ldap_int_connect_cbs( ld, sb, &s, srv, (struct sockaddr *)&sin ); if ( i ) rc = i; else break;
But this is inside a for loop that uses i as a counter for the loop control. ldap_int_connect_cbs returns an error code so, unless I'm missing something, setting i to that will break the loop control.
Shall I put in a bug report for this?
Ian