}
query.scope = lud->lud_scope;
query.filter = str2filter( lud->lud_filter );
+ if ( query.filter == NULL ) {
+ rc = -1;
+ goto error;
+ }
tempstr.bv_val = ch_malloc( strlen( lud->lud_filter ) + 1 );
tempstr.bv_len = 0;
} else if ( rs->sr_err == LDAP_SIZELIMIT_EXCEEDED
&& si->qtemp->limitttl )
{
- si->caching_reason = PC_SIZELIMIT;
Entry *e;
+
+ si->caching_reason = PC_SIZELIMIT;
for (;si->head; si->head=e) {
e = si->head->e_private;
si->head->e_private = NULL;
}
*p2 = '\0';
op->o_tmpfree( vals, op->o_tmpmemctx );
- return str2filter_x( op, fbv->bv_val );
+
+ /* FIXME: are we sure str2filter_x can't fail?
+ * caller needs to check */
+ {
+ Filter *f = str2filter_x( op, fbv->bv_val );
+ assert( f != NULL );
+ return f;
+ }
}
/* Check if the requested entry is from the cache and has a valid
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);
return SLAP_CB_CONTINUE;
}
+static int
+pcache_entry_release( Operation *op, Entry *e, int rw )
+{
+ slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
+ cache_manager *cm = on->on_bi.bi_private;
+ BackendDB *db = op->o_bd;
+ int rc;
+
+ op->o_bd = &cm->db;
+ rc = be_entry_release_rw( op, e, rw );
+ op->o_bd = db;
+ return rc;
+}
+
#ifdef PCACHE_MONITOR
static int
#endif /* PCACHE_CONTROL_PRIVDB */
pcache.on_bi.bi_extended = pcache_op_extended;
+ pcache.on_bi.bi_entry_release_rw = pcache_entry_release;
pcache.on_bi.bi_chk_controls = pcache_chk_controls;
pcache.on_bi.bi_cf_ocs = pcocs;