]> git.sur5r.net Git - openldap/commitdiff
ITS#5173 simplify defer open behavior
authorHoward Chu <hyc@openldap.org>
Mon, 8 Oct 2007 07:37:53 +0000 (07:37 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 8 Oct 2007 07:37:53 +0000 (07:37 +0000)
servers/slapd/overlays/pcache.c
servers/slapd/overlays/translucent.c

index f9b66904e3dc71c41258a4e4cc320d3c6113264d..e93b2b1d2a8ecce2989c2c1d52d28104e0e25403 100644 (file)
@@ -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;
index d4ad2a8c88370eab9463f3aca5f83a8279b23a18..53dde555932fa2853815ce3ce144f858a90c6609 100644 (file)
@@ -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;
 }
 
 /*