From 1150becd639c8a1abcbecb297d81be09f909c2b1 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Fri, 18 Apr 2003 17:17:18 +0000 Subject: [PATCH] use a macro for the entry buffer size --- servers/slapd/back-monitor/back-monitor.h | 3 +++ servers/slapd/back-monitor/backend.c | 2 +- servers/slapd/back-monitor/conn.c | 6 +++--- servers/slapd/back-monitor/database.c | 4 ++-- servers/slapd/back-monitor/init.c | 2 +- servers/slapd/back-monitor/listener.c | 2 +- servers/slapd/back-monitor/log.c | 2 +- servers/slapd/back-monitor/operation.c | 2 +- servers/slapd/back-monitor/rww.c | 2 +- servers/slapd/back-monitor/sent.c | 2 +- servers/slapd/back-monitor/thread.c | 4 ++-- servers/slapd/back-monitor/time.c | 2 +- 12 files changed, 18 insertions(+), 15 deletions(-) diff --git a/servers/slapd/back-monitor/back-monitor.h b/servers/slapd/back-monitor/back-monitor.h index 6618456d67..8366b6cd23 100644 --- a/servers/slapd/back-monitor/back-monitor.h +++ b/servers/slapd/back-monitor/back-monitor.h @@ -227,6 +227,9 @@ extern struct monitorsubsys monitor_subsys[]; extern BackendDB *be_monitor; +/* increase this bufsize if entries in string form get too big */ +#define BACKMONITOR_BUFSIZE 1024 + /* * cache */ diff --git a/servers/slapd/back-monitor/backend.c b/servers/slapd/back-monitor/backend.c index aae18ed544..80db4fbab3 100644 --- a/servers/slapd/back-monitor/backend.c +++ b/servers/slapd/back-monitor/backend.c @@ -74,7 +74,7 @@ monitor_subsys_backend_init( e_tmp = NULL; for ( i = nBackendInfo; i--; ) { - char buf[1024]; + char buf[ BACKMONITOR_BUFSIZE ]; BackendInfo *bi; struct berval bv; int j; diff --git a/servers/slapd/back-monitor/conn.c b/servers/slapd/back-monitor/conn.c index e223b75f0f..0af556a58f 100644 --- a/servers/slapd/back-monitor/conn.c +++ b/servers/slapd/back-monitor/conn.c @@ -50,7 +50,7 @@ monitor_subsys_conn_init( Entry *e, *e_tmp, *e_conn; struct monitorentrypriv *mp; - char buf[1024]; + char buf[ BACKMONITOR_BUFSIZE ]; struct berval bv; assert( be != NULL ); @@ -235,7 +235,7 @@ monitor_subsys_conn_update( if ( n != -1 ) { Attribute *a; - char buf[16]; + char buf[] = "+9223372036854775807L"; a = attr_find( e->e_attrs, mi->ad_monitorCounter ); if ( a == NULL ) { @@ -259,7 +259,7 @@ conn_create( { struct monitorentrypriv *mp; struct tm *ltm; - char buf[ 1024 ]; + char buf[ BACKMONITOR_BUFSIZE ]; char buf2[ LDAP_LUTIL_GENTIME_BUFSIZE ]; char buf3[ LDAP_LUTIL_GENTIME_BUFSIZE ]; diff --git a/servers/slapd/back-monitor/database.c b/servers/slapd/back-monitor/database.c index 090ae17856..849a236fe8 100644 --- a/servers/slapd/back-monitor/database.c +++ b/servers/slapd/back-monitor/database.c @@ -78,7 +78,7 @@ monitor_subsys_database_init( e_tmp = NULL; for ( i = nBackendDB; i--; ) { - char buf[1024]; + char buf[ BACKMONITOR_BUFSIZE ]; int j; be = &backendDB[i]; @@ -209,7 +209,7 @@ monitor_back_add_plugin( Backend *be, Entry *e_database ) i = 0; do { Slapi_PluginDesc *srchdesc; - char buf[1024]; + char buf[ BACKMONITOR_BUFSIZE ]; struct berval bv; rc = slapi_pblock_get( pCurrentPB, SLAPI_PLUGIN_DESCRIPTION, diff --git a/servers/slapd/back-monitor/init.c b/servers/slapd/back-monitor/init.c index ec66046243..8e9b3933e3 100644 --- a/servers/slapd/back-monitor/init.c +++ b/servers/slapd/back-monitor/init.c @@ -303,7 +303,7 @@ monitor_back_db_open( Entry *e, *e_tmp; struct monitorentrypriv *mp; int i; - char buf[1024], *end_of_line; + char buf[ BACKMONITOR_BUFSIZE ], *end_of_line; const char *text; struct berval bv; struct m_s { diff --git a/servers/slapd/back-monitor/listener.c b/servers/slapd/back-monitor/listener.c index 37fc482c3e..3be41b5502 100644 --- a/servers/slapd/back-monitor/listener.c +++ b/servers/slapd/back-monitor/listener.c @@ -87,7 +87,7 @@ monitor_subsys_listener_init( e_tmp = NULL; for ( i = 0; l[i]; i++ ); for ( ; i--; ) { - char buf[1024]; + char buf[ BACKMONITOR_BUFSIZE ]; snprintf( buf, sizeof( buf ), "dn: cn=Listener %d,%s\n" diff --git a/servers/slapd/back-monitor/log.c b/servers/slapd/back-monitor/log.c index 6e29ecd75a..d3bca6dee5 100644 --- a/servers/slapd/back-monitor/log.c +++ b/servers/slapd/back-monitor/log.c @@ -214,7 +214,7 @@ monitor_subsys_log_modify( /* set the new debug level */ if ( rc == LDAP_SUCCESS ) { const char *text; - static char textbuf[1024]; + static char textbuf[ BACKMONITOR_BUFSIZE ]; /* check for abandon */ if ( op->o_abandon ) { diff --git a/servers/slapd/back-monitor/operation.c b/servers/slapd/back-monitor/operation.c index 928b5bf0e3..f799ef5eae 100644 --- a/servers/slapd/back-monitor/operation.c +++ b/servers/slapd/back-monitor/operation.c @@ -62,7 +62,7 @@ monitor_subsys_ops_init( Entry *e, *e_tmp, *e_op; struct monitorentrypriv *mp; - char buf[1024]; + char buf[ BACKMONITOR_BUFSIZE ]; int i; assert( be != NULL ); diff --git a/servers/slapd/back-monitor/rww.c b/servers/slapd/back-monitor/rww.c index 68d87c8118..d6da0aa111 100644 --- a/servers/slapd/back-monitor/rww.c +++ b/servers/slapd/back-monitor/rww.c @@ -48,7 +48,7 @@ monitor_subsys_rww_init( Entry *e, *e_tmp, *e_conn; struct monitorentrypriv *mp; - char buf[1024]; + char buf[ BACKMONITOR_BUFSIZE ]; struct berval bv; assert( be != NULL ); diff --git a/servers/slapd/back-monitor/sent.c b/servers/slapd/back-monitor/sent.c index f8719c3b16..bbf647c377 100644 --- a/servers/slapd/back-monitor/sent.c +++ b/servers/slapd/back-monitor/sent.c @@ -47,7 +47,7 @@ monitor_subsys_sent_init( Entry *e, *e_tmp, *e_sent; struct monitorentrypriv *mp; - char buf[1024]; + char buf[ BACKMONITOR_BUFSIZE ]; struct berval bv; assert( be != NULL ); diff --git a/servers/slapd/back-monitor/thread.c b/servers/slapd/back-monitor/thread.c index 169f48b968..0d76006758 100644 --- a/servers/slapd/back-monitor/thread.c +++ b/servers/slapd/back-monitor/thread.c @@ -48,7 +48,7 @@ monitor_subsys_thread_init( { struct monitorinfo *mi; Entry *e; - static char buf[1024]; + static char buf[ BACKMONITOR_BUFSIZE ]; struct berval bv; mi = ( struct monitorinfo * )be->be_private; @@ -91,7 +91,7 @@ monitor_subsys_thread_update( struct monitorinfo *mi = (struct monitorinfo *)op->o_bd->be_private; Attribute *a; struct berval *b = NULL; - char buf[1024]; + char buf[ BACKMONITOR_BUFSIZE ]; assert( mi != NULL ); diff --git a/servers/slapd/back-monitor/time.c b/servers/slapd/back-monitor/time.c index 9f7dc7c325..0a94519c9f 100644 --- a/servers/slapd/back-monitor/time.c +++ b/servers/slapd/back-monitor/time.c @@ -57,7 +57,7 @@ monitor_subsys_time_init( Entry *e, *e_tmp, *e_time; struct monitorentrypriv *mp; - char buf[1024]; + char buf[ BACKMONITOR_BUFSIZE ]; struct tm *tms; char tmbuf[ LDAP_LUTIL_GENTIME_BUFSIZE ]; -- 2.39.5