]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/result.c
Added LDAP_LOG messages
[openldap] / libraries / libldap / result.c
index 869769e65cbc2268515fda7faa34c0b166674ee6..16189ef36e2246ed9218a774f48043cc63054438 100644 (file)
@@ -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;
+                                       }
                                }
                        }