summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/globals.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldap/servers/slapd/globals.c')
-rw-r--r--ldap/servers/slapd/globals.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/ldap/servers/slapd/globals.c b/ldap/servers/slapd/globals.c
index c57a89ca..3be43127 100644
--- a/ldap/servers/slapd/globals.c
+++ b/ldap/servers/slapd/globals.c
@@ -88,9 +88,8 @@ Slapi_PBlock *repl_pb = NULL;
/*
* global variables that need mutex protection
*/
-PRInt32 ops_initiated;
-PRInt32 ops_completed;
-PRLock *ops_mutex;
+Slapi_Counter *ops_initiated;
+Slapi_Counter *ops_completed;
Slapi_Counter *num_conns;
@@ -171,4 +170,17 @@ set_entry_points()
sep->sep_slapd_ssl_init2 = (caddr_t)slapd_ssl_init2;
set_dll_entry_points( sep );
+ /* To apply the nsslapd-counters config value properly,
+ these values are initialized here after config file is read */
+ if (config_get_slapi_counters()) {
+ ops_initiated = slapi_counter_new();
+ ops_completed = slapi_counter_new();
+ g_set_num_entries_sent( slapi_counter_new() );
+ g_set_num_bytes_sent( slapi_counter_new() );
+ } else {
+ ops_initiated = NULL;
+ ops_completed = NULL;
+ g_set_num_entries_sent( NULL );
+ g_set_num_bytes_sent( NULL );
+ }
}