--- libraries/libldap/result.c 2004/03/25 11:15:52 1.93 +++ libraries/libldap/result.c 2004/07/24 01:13:29 1.94 @@ -1,5 +1,5 @@ /* result.c - wait for an ldap result */ -/* $OpenLDAP: pkg/ldap/libraries/libldap/result.c,v 1.92 2004/03/25 08:54:23 hyc Exp $ */ +/* $OpenLDAP: pkg/ldap/libraries/libldap/result.c,v 1.93 2004/03/25 11:15:52 hyc Exp $ */ /* This work is part of OpenLDAP Software . * * Copyright 1998-2004 The OpenLDAP Foundation. @@ -314,6 +314,7 @@ wait4msg( if( (*result = chkResponseList(ld, msgid, all)) != NULL ) { rc = (*result)->lm_msgtype; } else { + int lc_ready = 0; for ( lc = ld->ld_conns; lc != NULL; lc = nextlc ) { nextlc = lc->lconn_next; @@ -321,11 +322,12 @@ wait4msg( LBER_SB_OPT_DATA_READY, NULL ) ) { rc = try_read1msg( ld, msgid, all, lc->lconn_sb, &lc, result ); + lc_ready = 1; break; } } - if ( lc == NULL ) { + if ( !lc_ready ) { rc = ldap_int_select( ld, tvp ); #ifdef LDAP_DEBUG if ( rc == -1 ) {