X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-bdb%2Fconfig.c;h=d1bd93cd757d64a7d4427a2bf0b6b02effe54623;hb=190f161d741fb87417d743b64d0100dd6e2c0855;hp=b1a6d6d5dd19fe5209b8dad57766b86997345bb6;hpb=98a2c60c3a394ec89898764956feed895622c937;p=openldap diff --git a/servers/slapd/back-bdb/config.c b/servers/slapd/back-bdb/config.c index b1a6d6d5dd..d1bd93cd75 100644 --- a/servers/slapd/back-bdb/config.c +++ b/servers/slapd/back-bdb/config.c @@ -1,7 +1,7 @@ /* config.c - bdb backend configuration file routine */ /* $OpenLDAP$ */ /* - * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved. + * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file */ @@ -11,6 +11,7 @@ #include #include "back-bdb.h" +#include "external.h" #ifdef DB_DIRTY_READ # define SLAP_BDB_ALLOW_DIRTY_READ @@ -50,7 +51,7 @@ bdb_db_config( } else if ( strcasecmp( argv[0], "dirtyread" ) == 0 ) { bdb->bi_db_opflags |= DB_DIRTY_READ; #endif - /* transaction checkpoint configuration */ + /* transaction logging configuration */ } else if ( strcasecmp( argv[0], "dbnosync" ) == 0 ) { bdb->bi_dbenv_xflags |= DB_TXN_NOSYNC; @@ -68,10 +69,9 @@ bdb_db_config( /* lock detect configuration */ } else if ( strcasecmp( argv[0], "lockdetect" ) == 0 ) { -#ifndef NO_THREADS - if ( argc < 3 ) { + if ( argc < 2 ) { fprintf( stderr, "%s: line %d: " - "missing parameters in \"lockDetect \" line\n", + "missing parameters in \"lockDetect \" line\n", fname, lineno ); return 1; } @@ -93,24 +93,11 @@ bdb_db_config( } else { fprintf( stderr, "%s: line %d: " - "bad policy (%s) in \"lockDetect \" line\n", + "bad policy (%s) in \"lockDetect \" line\n", fname, lineno, argv[1] ); return 1; } - bdb->bi_lock_detect_seconds = strtol( argv[2], NULL, 0 ); - if( bdb->bi_lock_detect_seconds < 1 ) { - fprintf( stderr, "%s: line %d: " - "bad seconds (%s) in \"lockDetect \" line\n", - fname, lineno, argv[2] ); - return 1; - } -#else - fprintf( stderr, "%s: line %d: " - "NO THREADS: lockDetect line ignored\n", - fname, lineno ); -#endif - /* mode with which to create new database files */ } else if ( strcasecmp( argv[0], "mode" ) == 0 ) { if ( argc < 2 ) { @@ -121,7 +108,6 @@ bdb_db_config( } bdb->bi_dbenv_mode = strtol( argv[1], NULL, 0 ); -#if BDB_FILTER_INDICES /* attribute to index */ } else if ( strcasecmp( argv[0], "index" ) == 0 ) { int rc; @@ -139,10 +125,19 @@ bdb_db_config( rc = bdb_attr_index_config( bdb, fname, lineno, argc - 1, &argv[1] ); if( rc != LDAP_SUCCESS ) return 1; -#endif + + /* unique key for shared memory regions */ + } else if ( strcasecmp( argv[0], "shm_key" ) == 0 ) { + if ( argc < 2 ) { + fprintf( stderr, + "%s: line %d: missing key in \"shm_key \" line\n", + fname, lineno ); + return( 1 ); + } + bdb->bi_shm_key = atoi( argv[1] ); /* size of the cache in entries */ - } else if ( strcasecmp( argv[0], "cachesize" ) == 0 ) { + } else if ( strcasecmp( argv[0], "cachesize" ) == 0 ) { if ( argc < 2 ) { fprintf( stderr, "%s: line %d: missing size in \"cachesize \" line\n", @@ -151,6 +146,36 @@ bdb_db_config( } bdb->bi_cache.c_maxsize = atoi( argv[1] ); + /* depth of search stack cache in units of (IDL)s */ + } else if ( strcasecmp( argv[0], "searchstack" ) == 0 ) { + if ( argc < 2 ) { + fprintf( stderr, + "%s: line %d: missing depth in \"searchstack \" line\n", + fname, lineno ); + return( 1 ); + } + bdb->bi_search_stack_depth = atoi( argv[1] ); + if ( bdb->bi_search_stack_depth < MINIMUM_SEARCH_STACK_DEPTH ) { + fprintf( stderr, + "%s: line %d: depth %d too small, using %d\n", + fname, lineno, bdb->bi_search_stack_depth, + MINIMUM_SEARCH_STACK_DEPTH ); + bdb->bi_search_stack_depth = MINIMUM_SEARCH_STACK_DEPTH; + } + +#ifdef SLAP_IDL_CACHE + /* size of the IDL cache in entries */ + } else if ( strcasecmp( argv[0], "idlcachesize" ) == 0 ) { + if ( argc < 2 ) { + fprintf( stderr, + "%s: line %d: missing size in \"idlcachesize \" line\n", + fname, lineno ); + return( 1 ); + } + if ( !( slapMode & SLAP_TOOL_MODE ) ) + bdb->bi_idl_cache_max_size = atoi( argv[1] ); +#endif + /* anything else */ } else { fprintf( stderr, "%s: line %d: "