]> git.sur5r.net Git - openldap/commitdiff
use a macro for the entry buffer size
authorPierangelo Masarati <ando@openldap.org>
Fri, 18 Apr 2003 17:17:18 +0000 (17:17 +0000)
committerPierangelo Masarati <ando@openldap.org>
Fri, 18 Apr 2003 17:17:18 +0000 (17:17 +0000)
12 files changed:
servers/slapd/back-monitor/back-monitor.h
servers/slapd/back-monitor/backend.c
servers/slapd/back-monitor/conn.c
servers/slapd/back-monitor/database.c
servers/slapd/back-monitor/init.c
servers/slapd/back-monitor/listener.c
servers/slapd/back-monitor/log.c
servers/slapd/back-monitor/operation.c
servers/slapd/back-monitor/rww.c
servers/slapd/back-monitor/sent.c
servers/slapd/back-monitor/thread.c
servers/slapd/back-monitor/time.c

index 6618456d6793d3810068882887f355e94efb10d2..8366b6cd23fa2be97f44f9510d0b408dc87fb1a8 100644 (file)
@@ -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
  */
index aae18ed5442cae9f18b3b70b771cac456d503e9a..80db4fbab3b2ce3fa9bf3078a50cad005f3b9242 100644 (file)
@@ -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;
index e223b75f0f0f55d9da6738fc85a1366cc458a3ff..0af556a58f8e5bf38de5b4550f57568ee656f874 100644 (file)
@@ -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 ];
 
index 090ae178562910531442c3c913e5e16402b40e17..849a236fe8cf8e1260cab589c418599c2a25766c 100644 (file)
@@ -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,
index ec6604624306d7cf726de425ec7fa6929c194698..8e9b3933e3f70a67e7d23b64a943614b9b990fe8 100644 (file)
@@ -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 {
index 37fc482c3eaa927e7ceed10601baa8741e29696b..3be41b5502ab001fe8b2c9a601afb6fce03c4ce0 100644 (file)
@@ -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"
index 6e29ecd75a8c8d296d5e6a25652843ebbf21a786..d3bca6dee5913e9e5535edc740fb2bb59a862fc2 100644 (file)
@@ -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 ) {
index 928b5bf0e33c9d72bbb352355e2806c06dcdc257..f799ef5eae6e2ab28bcd033c25c971401e867c68 100644 (file)
@@ -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 );
index 68d87c81181ea9373f91e71ba5a019a0c9fb69b2..d6da0aa1117aefe4a845cb26ab5c101418217c32 100644 (file)
@@ -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 );
index f8719c3b168b1bf1cdf4c5aee3958fdceedea728..bbf647c377476c5666dd3816a09413c2069885ed 100644 (file)
@@ -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 );
index 169f48b968fb3962dda620d01f5e9b6c6d30a393..0d7600675802d1fde89b4537dc6c46a6c134b5c3 100644 (file)
@@ -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 );
 
index 9f7dc7c325ced62d13aa2ed344957331616ccbb3..0a94519c9f8da7a185f699eb1f8aec2722715c49 100644 (file)
@@ -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 ];