]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/init.c
Merge remote-tracking branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_5
[openldap] / servers / slapd / init.c
index d99453df33daac576062a3ace69d68b5caa72a31..79271d081bc24d7967d1d00a3612041ae945caf9 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2008 The OpenLDAP Foundation.
+ * Copyright 1998-2013 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -55,17 +55,13 @@ int         ldap_syslog_level = LOG_DEBUG;
 
 BerVarray default_referral = NULL;
 
-struct berval AllUser = BER_BVC( LDAP_ALL_USER_ATTRIBUTES );
-struct berval AllOper = BER_BVC( LDAP_ALL_OPERATIONAL_ATTRIBUTES );
-struct berval NoAttrs = BER_BVC( LDAP_NO_ATTRS );
-
 /*
  * global variables that need mutex protection
  */
 ldap_pvt_thread_pool_t connection_pool;
-int                    connection_pool_max = SLAP_MAX_WORKER_THREADS;
+int            connection_pool_max = SLAP_MAX_WORKER_THREADS;
+int            connection_pool_queues = 1;
 int            slap_tool_thread_max = 1;
-ldap_pvt_thread_mutex_t        gmtime_mutex;
 
 slap_counters_t                        slap_counters, *slap_counters_list;
 
@@ -140,8 +136,8 @@ slap_init( int mode, const char *name )
 
                slap_name = name;
 
-               ldap_pvt_thread_pool_init( &connection_pool,
-                               connection_pool_max, 0);
+               ldap_pvt_thread_pool_init_q( &connection_pool,
+                               connection_pool_max, 0, connection_pool_queues);
 
                slap_counters_init( &slap_counters );
 
@@ -149,7 +145,6 @@ slap_init( int mode, const char *name )
                LDAP_STAILQ_INIT( &slapd_rq.task_list );
                LDAP_STAILQ_INIT( &slapd_rq.run_list );
 
-               ldap_pvt_thread_mutex_init( &gmtime_mutex );
                slap_passwd_init();
 
                rc = slap_sasl_init();
@@ -179,16 +174,6 @@ slap_init( int mode, const char *name )
                return 1;
        }
 
-#ifdef HAVE_TLS
-       /* Library defaults to full certificate checking. This is correct when
-        * a client is verifying a server because all servers should have a
-        * valid cert. But few clients have valid certs, so we want our default
-        * to be no checking. The config file can override this as usual.
-        */
-       rc = 0;
-       (void) ldap_pvt_tls_set_option( NULL, LDAP_OPT_X_TLS_REQUIRE_CERT, &rc );
-#endif
-
        if ( frontend_init() ) {
                slap_debug |= LDAP_DEBUG_NONE;
                Debug( LDAP_DEBUG_ANY,
@@ -227,12 +212,15 @@ slap_init( int mode, const char *name )
 
 int slap_startup( Backend *be )
 {
+       int rc;
        Debug( LDAP_DEBUG_TRACE,
                "%s startup: initiated.\n",
                slap_name, 0, 0 );
 
-
-       return backend_startup( be );
+       rc = backend_startup( be );
+       if ( !rc && ( slapMode & SLAP_SERVER_MODE ))
+               slapMode |= SLAP_SERVER_RUNNING;
+       return rc;
 }
 
 int slap_shutdown( Backend *be )