From 21e33fed3364a9714ba0aac9b47497ed5cbc63b1 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Mon, 22 Aug 2005 09:41:36 +0000 Subject: [PATCH] treat TRUE/FLASE like SUCCESS; don't chase "" referrals --- libraries/libldap/result.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index be0de7ab0f..a4f1093bbe 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -660,15 +660,31 @@ nextresp2: } else { lr->lr_res_error = lr_res_error; } + lr_res_error = NULL; } - if ( lderr != LDAP_SUCCESS ) { + switch ( lderr ) { + case LDAP_SUCCESS: + case LDAP_COMPARE_TRUE: + case LDAP_COMPARE_FALSE: + break; + + default: + if ( lr->lr_res_error == NULL + || lr->lr_res_error[ 0 ] == '\0' ) + { + break; + } + /* referrals are in error string */ refer_cnt = ldap_chase_referrals( ld, lr, &lr->lr_res_error, -1, &hadref ); lr->lr_status = LDAP_REQST_COMPLETED; Debug( LDAP_DEBUG_TRACE, - "read1msg: V2 referral chased, mark request completed, id = %d\n", lr->lr_msgid, 0, 0); + "read1msg: V2 referral chased, " + "mark request completed, id = %d\n", + lr->lr_msgid, 0, 0 ); + break; } /* save errno, message, and matched string */ -- 2.39.5