From: Pierangelo Masarati Date: Sat, 27 May 2006 10:17:34 +0000 (+0000) Subject: count requests and responses in logs X-Git-Tag: OPENLDAP_REL_ENG_2_4_3ALPHA~9^2~210 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7a3ff8ddc265bb36e6291b426b2fdbec9bbe4020;p=openldap count requests and responses in logs --- diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index ad1a598933..2b9060d9d7 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -691,13 +691,15 @@ ldap_dump_requests_and_responses( LDAP *ld ) { LDAPRequest *lr; LDAPMessage *lm, *l; + int i; Debug( LDAP_DEBUG_TRACE, "** ld %p Outstanding Requests:\n", (void *)ld, 0, 0 ); - if ( ( lr = ld->ld_requests ) == NULL ) { + lr = ld->ld_requests; + if ( lr == NULL ) { Debug( LDAP_DEBUG_TRACE, " Empty\n", 0, 0, 0 ); } - for ( ; lr != NULL; lr = lr->lr_next ) { + for ( i = 0; lr != NULL; lr = lr->lr_next, i++ ) { Debug( LDAP_DEBUG_TRACE, " * msgid %d, origid %d, status %s\n", lr->lr_msgid, lr->lr_origid, ( lr->lr_status == LDAP_REQST_INPROGRESS ) ? "InProgress" : @@ -709,11 +711,12 @@ ldap_dump_requests_and_responses( LDAP *ld ) Debug( LDAP_DEBUG_TRACE, " outstanding referrals %d, parent count %d\n", lr->lr_outrefcnt, lr->lr_parentcnt, 0 ); } + Debug( LDAP_DEBUG_TRACE, " ld %p request count %d\n", (void *)ld, i, 0 ); Debug( LDAP_DEBUG_TRACE, "** ld %p Response Queue:\n", (void *)ld, 0, 0 ); if ( ( lm = ld->ld_responses ) == NULL ) { Debug( LDAP_DEBUG_TRACE, " Empty\n", 0, 0, 0 ); } - for ( ; lm != NULL; lm = lm->lm_next ) { + for ( i = 0; lm != NULL; lm = lm->lm_next, i++ ) { Debug( LDAP_DEBUG_TRACE, " * msgid %d, type %lu\n", lm->lm_msgid, (unsigned long)lm->lm_msgtype, 0 ); if ( ( l = lm->lm_chain ) != NULL ) { @@ -726,6 +729,7 @@ ldap_dump_requests_and_responses( LDAP *ld ) } } } + Debug( LDAP_DEBUG_TRACE, " ld %p response count %d\n", (void *)ld, i, 0 ); } #endif /* LDAP_DEBUG */