}
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
}
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) {
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;
}
/* 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;
+ }
}
}