]> git.sur5r.net Git - openldap/commitdiff
don't play with URL list if connect(2) is asynchronous
authorPierangelo Masarati <ando@openldap.org>
Wed, 21 Feb 2007 22:26:26 +0000 (22:26 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 21 Feb 2007 22:26:26 +0000 (22:26 +0000)
libraries/libldap/request.c

index ee0ec5013b9d0c05c8f694d0639940677d9094d6..f139e647eb05f045d00840ab6e594a59859e23a4 100644 (file)
@@ -377,11 +377,13 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc **srvlist, int use_ldsb,
                async = LDAP_BOOL_GET( &ld->ld_options, LDAP_BOOL_CONNECT_ASYNC );
 
                for ( srvp = srvlist; *srvp != NULL; srvp = &(*srvp)->lud_next ) {
-                       if ( ldap_int_open_connection( ld, lc, *srvp, async) != -1 )
-                       {
+                       int             rc;
+
+                       rc = ldap_int_open_connection( ld, lc, *srvp, async );
+                       if ( rc != -1 ) {
                                srv = *srvp;
 
-                               if ( ld->ld_urllist_proc ) {
+                               if ( ld->ld_urllist_proc && ( !async || rc != -2 ) ) {
                                        ld->ld_urllist_proc( ld, srvlist, srvp, ld->ld_urllist_params );
                                }