From 968663d6e4eae4f49a428efee37549d568d3a808 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 10 Mar 2010 22:25:42 +0000 Subject: [PATCH] Fix for CB_TAIL with cached results --- servers/slapd/overlays/pcache.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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); -- 2.39.5