From: Pierangelo Masarati Date: Mon, 22 Aug 2005 09:41:36 +0000 (+0000) Subject: treat TRUE/FLASE like SUCCESS; don't chase "" referrals X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~622 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=21e33fed3364a9714ba0aac9b47497ed5cbc63b1;p=openldap treat TRUE/FLASE like SUCCESS; don't chase "" referrals --- 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 */