]> git.sur5r.net Git - openldap/commitdiff
if for any reason ldap_search_ext() fails (e.g. ITS#3706) don't wait for results
authorPierangelo Masarati <ando@openldap.org>
Wed, 4 May 2005 23:16:56 +0000 (23:16 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 4 May 2005 23:16:56 +0000 (23:16 +0000)
servers/slapd/back-ldap/search.c

index edd5bba22de4b49be8dae0e7f1a6703e421fed93..c391347baa2f55ce726d71cf13f0503350b3d7fe 100644 (file)
@@ -119,18 +119,22 @@ retry:
 
        if ( rs->sr_err != LDAP_SUCCESS ) {
 fail:;
-               if ( rs->sr_err == LDAP_SERVER_DOWN ) {
-                       if ( do_retry ) {
-                               do_retry = 0;
-                               if ( ldap_back_retry( lc, op, rs, LDAP_BACK_DONTSEND ) ) {
-                                       goto retry;
-                               }
-                       }
-                       rc = ldap_back_op_result( lc, op, rs, msgid, LDAP_BACK_DONTSEND );
-                       ldap_back_freeconn( op, lc );
-                       lc = NULL;
+               if ( rs->sr_err != LDAP_SERVER_DOWN ) {
+                       rs->sr_err = slap_map_api2result( rs );
+                       rs->sr_text = NULL;
                        goto finish;
                }
+
+               if ( do_retry ) {
+                       do_retry = 0;
+                       if ( ldap_back_retry( lc, op, rs, LDAP_BACK_DONTSEND ) ) {
+                               goto retry;
+                       }
+               }
+               rc = ldap_back_op_result( lc, op, rs, msgid, LDAP_BACK_DONTSEND );
+               ldap_back_freeconn( op, lc );
+               lc = NULL;
+               goto finish;
        }
 
        /* We pull apart the ber result, stuff it into a slapd entry, and