X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fresult.c;h=6dffb0b192f4f53f7766e3fc225aded11664f073;hb=2b0819c4a9209784f762ec154ce4721038522a8a;hp=f9e70a2cf2778aaea0b864543277ba5539b045b2;hpb=a0828d6135945077d0e3d23e4327873a578a4ce9;p=openldap diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index f9e70a2cf2..6dffb0b192 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -166,9 +166,9 @@ chkResponseList( } for ( tmp = lm; tmp != NULL; tmp = tmp->lm_chain ) { - if ( lm->lm_msgtype != LDAP_RES_SEARCH_ENTRY - && lm->lm_msgtype != LDAP_RES_SEARCH_REFERENCE - && lm->lm_msgtype != LDAP_RES_EXTENDED_PARTIAL ) + if ( tmp->lm_msgtype != LDAP_RES_SEARCH_ENTRY + && tmp->lm_msgtype != LDAP_RES_SEARCH_REFERENCE + && tmp->lm_msgtype != LDAP_RES_EXTENDED_PARTIAL ) { break; } @@ -211,6 +211,7 @@ chkResponseList( #endif return lm; } + static int wait4msg( LDAP *ld, @@ -367,10 +368,16 @@ try_read1msg( } ber = lc->lconn_ber; - assert( BER_VALID (ber) ); + assert( LBER_VALID (ber) ); /* 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) { @@ -418,7 +425,14 @@ 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) { + char *blank; + ber_scanf(ber, "a{", &blank); + if (blank) + ber_memfree(blank); + } +#endif /* the message type */ if ( (tag = ber_peek_tag( ber, &len )) == LBER_ERROR ) { ld->ld_errno = LDAP_DECODING_ERROR; @@ -597,9 +611,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; + } } }