From: Howard Chu Date: Wed, 10 Mar 2010 22:25:42 +0000 (+0000) Subject: Fix for CB_TAIL with cached results X-Git-Tag: MIGRATION_CVS2GIT~671 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=968663d6e4eae4f49a428efee37549d568d3a808;p=openldap Fix for CB_TAIL with cached results --- diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index 3623f37245..1b75814fba 100644 --- a/servers/slapd/overlays/pcache.c +++ b/servers/slapd/overlays/pcache.c @@ -3018,14 +3018,22 @@ pcache_op_search( pbi->bi_cq = answerable; op->o_bd = &cm->db; -#if 0 if ( cm->response_cb == PCACHE_RESPONSE_CB_TAIL ) { + slap_callback cb; /* The cached entry was already processed by any * other overlays, so don't let it get processed again. + * + * This loop removes over_back_response from the stack. */ - op->o_callback = NULL; + if ( overlay_callback_after_backover( op, &cb, 0) == 0 ) { + slap_callback **scp; + for ( scp = &op->o_callback; *scp != NULL; + scp = &(*scp)->sc_next ) { + if ( (*scp)->sc_next == &cb ) + *scp = cb.sc_next; + } + } } -#endif i = cm->db.bd_info->bi_op_search( op, rs ); } ldap_pvt_thread_rdwr_runlock(&answerable->rwlock);