From 70ed7d58a670422e89868a9ac04df8981e6bfa4a Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 21 Aug 2007 15:36:21 +0000 Subject: [PATCH] re-fix previous commit --- servers/slapd/back-sql/search.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/servers/slapd/back-sql/search.c b/servers/slapd/back-sql/search.c index 2922d47ccc..e0777f3e82 100644 --- a/servers/slapd/back-sql/search.c +++ b/servers/slapd/back-sql/search.c @@ -2340,6 +2340,9 @@ backsql_search( Operation *op, SlapReply *rs ) rs->sr_ref = NULL; rs->sr_matched = NULL; rs->sr_entry = NULL; + if ( rs->sr_err == LDAP_REFERRAL ) { + rs->sr_err = LDAP_SUCCESS; + } goto next_entry; } @@ -2452,15 +2455,13 @@ next_entry2:; } end_of_search:; - if ( rs->sr_err == LDAP_SUCCESS ) { - if ( rs->sr_nentries > 0 ) { - rs->sr_ref = rs->sr_v2ref; - rs->sr_err = (rs->sr_v2ref == NULL) ? LDAP_SUCCESS - : LDAP_REFERRAL; - - } else { - rs->sr_err = bsi.bsi_status; - } + if ( rs->sr_nentries > 0 ) { + rs->sr_ref = rs->sr_v2ref; + rs->sr_err = (rs->sr_v2ref == NULL) ? LDAP_SUCCESS + : LDAP_REFERRAL; + + } else { + rs->sr_err = bsi.bsi_status; } send_results:; -- 2.39.5