From: Pierangelo Masarati Date: Sun, 4 Sep 2005 23:54:30 +0000 (+0000) Subject: all right, don't worry about free() by now X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~484 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=61e06b4ef2042511bf73b6a48ccbd9b0aa5c795b;p=openldap all right, don't worry about free() by now --- diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index d383f7614d..73ae35a272 100644 --- a/servers/slapd/overlays/pcache.c +++ b/servers/slapd/overlays/pcache.c @@ -1210,49 +1210,35 @@ add_filter_attrs( * perform the remote query without control and cache all results, * performing the pagedResults search only within the client * and the proxy. This requires pcache to understand pagedResults. */ -static int -proxy_cache_remove_paged_results( - Operation *op, - SlapReply *rs ) -{ - if ( op->o_pagedresults == SLAP_CONTROL_CRITICAL ) { - Debug( LDAP_DEBUG_ANY, "%s: " - "critical pagedResults control disabled with proxy cache.\n", - op->o_log_prefix, 0, 0 ); - - } else if ( op->o_pagedresults == SLAP_CONTROL_NONCRITICAL ) { - Debug( LDAP_DEBUG_ANY, "%s: " - "non-critical pagedResults control disabled with proxy cache; stripped.\n", - op->o_log_prefix, 0, 0 ); - } - - assert( op->o_pagedresults_state != NULL ); - op->o_tmpfree( op->o_pagedresults_state, op->o_tmpmemctx ); - op->o_pagedresults_state = NULL; - - return 0; -} - static int proxy_cache_chk_controls( Operation *op, SlapReply *rs ) { - int rc = SLAP_CB_CONTINUE; + const char *non = ""; + const char *stripped = ""; - if ( op->o_pagedresults ) { - int tmprc; + switch( op->o_pagedresults ) { + case SLAP_CONTROL_NONCRITICAL: + non = "non-"; + stripped = "; stripped"; + /* fallthru */ - tmprc = slap_remove_control( op, rs, slap_cids.sc_pagedResults, - proxy_cache_remove_paged_results ); - if ( tmprc != SLAP_CB_CONTINUE ) { - rc = tmprc; - } - } + case SLAP_CONTROL_CRITICAL: + Debug( LDAP_DEBUG_ANY, "%s: " + "%scritical pagedResults control " + "disabled with proxy cache%s.\n", + op->o_log_prefix, non, stripped ); + + slap_remove_control( op, rs, slap_cids.sc_pagedResults, NULL ); + break; - rs->sr_err = rc; + default: + rs->sr_err = SLAP_CB_CONTINUE; + break; + } - return rc; + return rs->sr_err; } static int