From: Howard Chu Date: Mon, 8 Oct 2007 07:37:53 +0000 (+0000) Subject: ITS#5173 simplify defer open behavior X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~535 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ade1fcff20d9adbda0898bb5494e842716488f17;p=openldap ITS#5173 simplify defer open behavior --- diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index f9b66904e3..e93b2b1d2a 100644 --- a/servers/slapd/overlays/pcache.c +++ b/servers/slapd/overlays/pcache.c @@ -2692,6 +2692,7 @@ pc_cfadd( Operation *op, SlapReply *rs, Entry *p, ConfigArgs *ca ) } bv.bv_val = ca->cr_msg; ca->be = &cm->db; + cm->defer_db_open = 0; /* We can only create this entry if the database is table-driven */ @@ -2861,8 +2862,6 @@ pc_cf_gen( ConfigArgs *c ) Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return( 1 ); } - if ( CONFIG_ONLINE_ADD( c )) - cm->defer_db_open = 1; cm->cc_period = (time_t)t; Debug( pcache_debug, @@ -3131,7 +3130,7 @@ pcache_db_init( cm->max_queries = 10000; cm->save_queries = 0; cm->response_cb = PCACHE_RESPONSE_CB_TAIL; - cm->defer_db_open = 0; + cm->defer_db_open = 1; cm->cc_period = 1000; cm->cc_paused = 0; cm->cc_arg = NULL; diff --git a/servers/slapd/overlays/translucent.c b/servers/slapd/overlays/translucent.c index d4ad2a8c88..53dde55593 100644 --- a/servers/slapd/overlays/translucent.c +++ b/servers/slapd/overlays/translucent.c @@ -131,6 +131,7 @@ translucent_cfadd( Operation *op, SlapReply *rs, Entry *e, ConfigArgs *ca ) } bv.bv_val = ca->cr_msg; ca->be = &ov->db; + ov->defer_db_open = 0; /* We can only create this entry if the database is table-driven */ @@ -717,19 +718,15 @@ static int translucent_db_config( { slap_overinst *on = (slap_overinst *) be->bd_info; translucent_info *ov = on->on_bi.bi_private; - int rc = SLAP_CONF_UNKNOWN; Debug(LDAP_DEBUG_TRACE, "==> translucent_db_config: %s\n", argc ? argv[0] : "", 0, 0); /* Something for the captive database? */ - if ( ov->db.bd_info && ov->db.bd_info->bi_db_config ) { - rc = ov->db.bd_info->bi_db_config( &ov->db, fname, lineno, + if ( ov->db.bd_info && ov->db.bd_info->bi_db_config ) + return ov->db.bd_info->bi_db_config( &ov->db, fname, lineno, argc, argv ); - if ( rc == 0 ) - ov->defer_db_open = 0; - } - return rc; + return SLAP_CONF_UNKNOWN; } /*