]> git.sur5r.net Git - openldap/commitdiff
only wait if no entry was returned
authorPierangelo Masarati <ando@openldap.org>
Tue, 4 Apr 2006 17:41:13 +0000 (17:41 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 4 Apr 2006 17:41:13 +0000 (17:41 +0000)
servers/slapd/back-meta/search.c

index 32e2b27fc98a544d1c498ec1a938cd990e3c8934..ae6da9dc586d44c3a7572dbd3293202f1934b27e 100644 (file)
@@ -474,7 +474,10 @@ really_bad:;
                                }
                                op->o_private = savepriv;
 
+                               /* don't wait any longer... */
                                gotit = 1;
+                               tv.tv_sec = 0;
+                               tv.tv_usec = 0;
 
 #if 0
                                /*
@@ -753,13 +756,11 @@ really_bad:;
                        }
                }
 
+               /* if no entry was found during this loop,
+                * set a minimal timeout */
                if ( gotit == 0 ) {
                        LDAP_BACK_TV_SET( &tv );
                         ldap_pvt_thread_yield();
-
-               } else {
-                       tv.tv_sec = 0;
-                       tv.tv_usec = 0;
                }
        }