X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fresult.c;h=16189ef36e2246ed9218a774f48043cc63054438;hb=b4243bc119b2f88318103176c7c671662c9ff371;hp=869769e65cbc2268515fda7faa34c0b166674ee6;hpb=978e417699699579fb0b858ad485f36399220c4d;p=openldap diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index 869769e65c..16189ef36e 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -1,6 +1,6 @@ /* $OpenLDAP$ */ /* - * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. + * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file */ /* Portions @@ -272,13 +272,13 @@ wait4msg( } if ( lc == NULL ) { - rc = do_ldap_select( ld, tvp ); + rc = ldap_int_select( ld, tvp ); #ifdef LDAP_DEBUG if ( rc == -1 ) { Debug( LDAP_DEBUG_TRACE, - "do_ldap_select returned -1: errno %d\n", + "ldap_int_select returned -1: errno %d\n", errno, 0, 0 ); } #endif @@ -372,6 +372,12 @@ try_read1msg( /* get the next message */ errno = 0; +#ifdef LDAP_CONNECTIONLESS + if ( LDAP_IS_UDP(ld) ) { + struct sockaddr from; + ber_int_sb_read(sb, &from, sizeof(struct sockaddr)); + } +#endif if ( (tag = ber_get_next( sb, &len, ber )) != LDAP_TAG_MESSAGE ) { if ( tag == LBER_DEFAULT) { @@ -419,7 +425,12 @@ try_read1msg( ber_free( ber, 1 ); return( -2 ); /* continue looking */ } - +#ifdef LDAP_CONNECTIONLESS + if (LDAP_IS_UDP(ld) && ld->ld_options.ldo_version == LDAP_VERSION2) { + struct berval blank; + ber_scanf(ber, "m{", &blank); + } +#endif /* the message type */ if ( (tag = ber_peek_tag( ber, &len )) == LBER_ERROR ) { ld->ld_errno = LDAP_DECODING_ERROR; @@ -598,9 +609,12 @@ Debug( LDAP_DEBUG_TRACE, } /* Check if all requests are finished, lr is now parent */ - for(tmplr=lr ; tmplr != NULL; tmplr=tmplr->lr_refnext) { + tmplr = lr; + if (tmplr->lr_status == LDAP_REQST_COMPLETED) { + for(tmplr=lr->lr_child; tmplr != NULL; tmplr=tmplr->lr_refnext) { if( tmplr->lr_status != LDAP_REQST_COMPLETED) { break; + } } }