X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fmodify.c;h=7cb5b6f4524a8fe67c17a84a04e4a6a89a0ece1f;hb=1fbbc1181152a32c1b9b82342ad6d63034ec7fbb;hp=49c657d5f8b761dfe1abd077492b6b3800e3cca2;hpb=486eaa69b6b2efe5f75e81808dd268ea65773d1b;p=openldap diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index 49c657d5f8..7cb5b6f452 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -1,6 +1,6 @@ /* $OpenLDAP$ */ /* - * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved. + * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file */ /* @@ -269,8 +269,32 @@ do_modify( } #endif - Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu MOD dn=\"%s\"\n", - op->o_connid, op->o_opid, dn.bv_val, 0, 0 ); + if ( StatslogTest( LDAP_DEBUG_STATS ) ) { + char abuf[BUFSIZ/2], *ptr = abuf; + int len = 0; + + Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu MOD dn=\"%s\"\n", + op->o_connid, op->o_opid, dn.bv_val, 0, 0 ); + + for ( tmp = modlist; tmp != NULL; tmp = tmp->sml_next ) { + if (len + 1 + tmp->sml_type.bv_len > sizeof(abuf)) { + Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu MOD attr=%s\n", + op->o_connid, op->o_opid, abuf, 0, 0 ); + len = 0; + ptr = abuf; + } + if (len) { + *ptr++ = ' '; + len++; + } + ptr = lutil_strcopy(ptr, tmp->sml_type.bv_val); + len += tmp->sml_type.bv_len; + } + if (len) { + Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu MOD attr=%s\n", + op->o_connid, op->o_opid, abuf, 0, 0 ); + } + } manageDSAit = get_manageDSAit( op ); @@ -324,9 +348,11 @@ do_modify( * FIXME: is this correct? */ #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, "do_modify: modify preOps failed\n")); + LDAP_LOG( OPERATION, INFO, "do_modify: modify preOps " + "failed\n", 0, 0, 0 ); #else - Debug (LDAP_DEBUG_TRACE, " modify preOps failed.\n", 0, 0, 0); + Debug(LDAP_DEBUG_TRACE, "do_modify: modify preOps failed.\n", + 0, 0, 0); #endif } #endif /* defined( LDAP_SLAPI ) */ @@ -418,9 +444,11 @@ do_modify( * FIXME: is this correct? */ #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, "do_modify: modify postOps failed\n")); + LDAP_LOG( OPERATION, INFO, "do_modify: modify postOps " + "failed\n", 0, 0, 0 ); #else - Debug (LDAP_DEBUG_TRACE, " modify postOps failed.\n", 0, 0, 0); + Debug(LDAP_DEBUG_TRACE, "do_modify: modify postOps " + "failed.\n", 0, 0, 0); #endif } #endif /* defined( LDAP_SLAPI ) */