[Date Prev][Date Next]
RE: How to get the socket to listen for replies from referral connections?
> -----Original Message-----
> From: Howard Chu [mailto:firstname.lastname@example.org]
> Sent: Friday, January 28, 2011 1:20 AM
> > - has anything been added in more recent versions that will help with
> 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.
> callback function gets the sockbuf as one of the parameters.
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;
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?