]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/init.c
Backout the input exhaustion change, it loops. Still looking for
[openldap] / servers / slapd / init.c
index 43af8d0a14d7f7b825a51f78ccc3315a874a012d..dc5091066331c30df0bd8eec0bbc602b66d470ff 100644 (file)
@@ -8,7 +8,6 @@
 #include <ac/string.h>
 #include <ac/time.h>
 
-#include "portable.h"
 #include "slap.h"
 
 /*
@@ -24,9 +23,7 @@ int           ldap_syslog;
 #endif
 
 int            ldap_syslog_level = LOG_DEBUG;
-char           *default_referral;
-time_t         starttime;
-ldap_pvt_thread_t      listener_tid;
+struct berval **default_referral = NULL;
 int            g_argc;
 char           **g_argv;
 
@@ -37,22 +34,20 @@ int                         active_threads;
 ldap_pvt_thread_mutex_t        active_threads_mutex;
 ldap_pvt_thread_cond_t active_threads_cond;
 
-time_t                 currenttime;
-ldap_pvt_thread_mutex_t        currenttime_mutex;
-
-ldap_pvt_thread_mutex_t        new_conn_mutex;
-
+ldap_pvt_thread_mutex_t        gmtime_mutex;
 #ifdef SLAPD_CRYPT
 ldap_pvt_thread_mutex_t        crypt_mutex;
 #endif
 
 int                            num_conns;
-long                   ops_initiated;
-long                   ops_completed;
-ldap_pvt_thread_mutex_t        ops_mutex;
+long                   num_ops_initiated;
+long                   num_ops_completed;
+ldap_pvt_thread_mutex_t        num_ops_mutex;
 
 long                   num_entries_sent;
+long                   num_refs_sent;
 long                   num_bytes_sent;
+long                   num_pdu_sent;
 ldap_pvt_thread_mutex_t        num_sent_mutex;
 /*
  * these mutexes must be used when calling the entry2str()
@@ -64,6 +59,8 @@ ldap_pvt_thread_mutex_t       replog_mutex;
 static char* slap_name;
 int slapMode = SLAP_UNDEFINED_MODE;
 
+static ldap_pvt_thread_mutex_t currenttime_mutex;
+
 int
 slap_init( int mode, char *name )
 {
@@ -84,6 +81,7 @@ slap_init( int mode, char *name )
                case SLAP_TOOL_MODE:
 #ifdef SLAPD_BDB2
                case SLAP_TIMEDSERVER_MODE:
+               case SLAP_TOOLID_MODE:
 #endif
 
                        Debug( LDAP_DEBUG_TRACE,
@@ -97,12 +95,13 @@ slap_init( int mode, char *name )
                        ldap_pvt_thread_mutex_init( &active_threads_mutex );
                        ldap_pvt_thread_cond_init( &active_threads_cond );
 
-                       ldap_pvt_thread_mutex_init( &new_conn_mutex );
                        ldap_pvt_thread_mutex_init( &currenttime_mutex );
                        ldap_pvt_thread_mutex_init( &entry2str_mutex );
                        ldap_pvt_thread_mutex_init( &replog_mutex );
-                       ldap_pvt_thread_mutex_init( &ops_mutex );
+                       ldap_pvt_thread_mutex_init( &num_ops_mutex );
                        ldap_pvt_thread_mutex_init( &num_sent_mutex );
+
+                       ldap_pvt_thread_mutex_init( &gmtime_mutex );
 #ifdef SLAPD_CRYPT
                        ldap_pvt_thread_mutex_init( &crypt_mutex );
 #endif
@@ -157,7 +156,18 @@ int slap_destroy(void)
 
        rc = backend_destroy();
 
+       ldap_pvt_thread_destroy();
+
        /* should destory the above mutex */
        return rc;
 }
 
+/* should create a utils.c for these */
+time_t slap_get_time(void)
+{
+       time_t t;
+       ldap_pvt_thread_mutex_lock( &currenttime_mutex );
+       time( &t );
+       ldap_pvt_thread_mutex_unlock( &currenttime_mutex );
+       return t;
+}