op->o_tmpfree( tempstr.bv_val, op->o_tmpmemctx );
if (answerable) {
- /* Need to clear the callbacks of the original operation,
- * in case there are other overlays */
BackendDB *save_bd = op->o_bd;
slap_callback *save_cb = op->o_callback;
send_ldap_result( op, rs );
} else {
op->o_bd = &cm->db;
- op->o_callback = NULL;
+ if ( cm->response_cb == PCACHE_RESPONSE_CB_TAIL ) {
+ /* The cached entry was already processed by any
+ * other overlays, so don't let it get processed again.
+ */
+ op->o_callback = NULL;
+ }
i = cm->db.bd_info->bi_op_search( op, rs );
}
ldap_pvt_thread_rdwr_runlock(&answerable->rwlock);