]> git.sur5r.net Git - openldap/commitdiff
fix previous commit...
authorPierangelo Masarati <ando@openldap.org>
Sat, 11 Sep 2004 17:46:00 +0000 (17:46 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 11 Sep 2004 17:46:00 +0000 (17:46 +0000)
servers/slapd/back-monitor/sent.c

index de041f0b0d29133fd5ef405f77bf9644d552ec15..e4cc18d559a64983a9416300c2eac7f7bd3cad64 100644 (file)
 #include "back-monitor.h"
 
 enum {
-       MONITOR_SENT_ENTRIES = 0,
-       MONITOR_SENT_REFERRALS,
+       MONITOR_SENT_BYTES = 0,
        MONITOR_SENT_PDU,
-       MONITOR_SENT_BYTES,
+       MONITOR_SENT_ENTRIES,
+       MONITOR_SENT_REFERRALS,
 
        MONITOR_SENT_LAST
 };
@@ -40,11 +40,11 @@ struct monitor_sent_t {
        struct berval   rdn;
        struct berval   nrdn;
 } monitor_sent[] = {
-       { BER_BVC("cn=Bytes"),          BER_BVC("cn=bytes")             },
-       { BER_BVC("cn=PDU"),            BER_BVC("cn=pdu")               },
-       { BER_BVC("cn=Entries"),        BER_BVC("cn=entries")           },
-       { BER_BVC("cn=Referrals"),      BER_BVC("cn=referrals")         },
-       { BER_BVNULL,                   BER_BVNULL                      }
+       { BER_BVC("cn=Bytes"),          BER_BVNULL },
+       { BER_BVC("cn=PDU"),            BER_BVNULL },
+       { BER_BVC("cn=Entries"),        BER_BVNULL },
+       { BER_BVC("cn=Referrals"),      BER_BVNULL },
+       { BER_BVNULL,                   BER_BVNULL }
 };
 
 int
@@ -76,7 +76,7 @@ monitor_subsys_sent_init(
 
        for ( i = MONITOR_SENT_LAST; --i >= 0; ) {
                char                    buf[ BACKMONITOR_BUFSIZE ];
-               struct berval           bv;
+               struct berval           rdn, bv;
                Entry                   *e;
 
                snprintf( buf, sizeof( buf ),
@@ -107,9 +107,12 @@ monitor_subsys_sent_init(
                                monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0 );
                        return( -1 );
                }
+
+               /* steal normalized RDN */
+               dnRdn( &e->e_nname, &rdn );
+               ber_dupbv( &monitor_sent[i].nrdn, &rdn );
        
-               bv.bv_val = "0";
-               bv.bv_len = 1;
+               BER_BVSTR( &bv, "0" );
                attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, NULL );
        
                mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );