use a macro for the entry buffer size

This commit is contained in:
Pierangelo Masarati 2003-04-18 17:17:18 +00:00
parent 629885a269
commit 1150becd63
12 changed files with 18 additions and 15 deletions

View 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
*/

View 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;

View 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 ];

View 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,

View 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 {

View 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"

View 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 ) {

View 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 );

View 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 );

View 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 );

View 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 );

View 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 ];