"DESC 'Filter template, attrset, and cache TTL' "
"SYNTAX OMsDirectoryString )", NULL, NULL },
{ "response-callback", "head|tail(default)",
- 2, 2, 0, ARG_MAGIC|ARG_STRING|PC_RESP, pc_cf_gen,
+ 2, 2, 0, ARG_MAGIC|PC_RESP, pc_cf_gen,
"( OLcfgOvAt:2.4 NAME 'olcProxyResponseCB' "
"DESC 'Response callback position in overlay stack' "
"SYNTAX OMsDirectoryString )", NULL, NULL },
break;
case PC_RESP:
if ( cm->response_cb == PCACHE_RESPONSE_CB_HEAD ) {
- bv.bv_val = "head";
- bv.bv_len = STRLENOF("head");
+ BER_BVSTR( &bv, "head" );
} else {
- bv.bv_val = "tail";
- bv.bv_len = STRLENOF("tail");
+ BER_BVSTR( &bv, "tail" );
}
value_add_one( &c->rvalue_vals, &bv );
break;
slap_overinst *on = (slap_overinst *)be->bd_info;
cache_manager *cm = on->on_bi.bi_private;
query_manager *qm = cm->qm;
- int rc = 0;
- if ( cm->db.bd_info->bi_db_destroy ) {
- rc = cm->db.bd_info->bi_db_destroy( &cm->db );
- }
- ldap_pvt_thread_mutex_destroy(&qm->lru_mutex);
- ldap_pvt_thread_mutex_destroy(&cm->cache_mutex);
- ldap_pvt_thread_mutex_destroy(&cm->remove_mutex);
+ /* cleanup stuff inherited from the original database... */
+ cm->db.be_suffix = NULL;
+ cm->db.be_nsuffix = NULL;
+ BER_BVZERO( &cm->db.be_rootdn );
+ BER_BVZERO( &cm->db.be_rootndn );
+ BER_BVZERO( &cm->db.be_rootpw );
+ /* FIXME: there might be more... */
+
+ backend_destroy_one( &cm->db, 0 );
+
+ ldap_pvt_thread_mutex_destroy( &qm->lru_mutex );
+ ldap_pvt_thread_mutex_destroy( &cm->cache_mutex );
+ ldap_pvt_thread_mutex_destroy( &cm->remove_mutex );
free( qm );
free( cm );
- return rc;
+
+ return 0;
}
static slap_overinst proxy_cache;