From: Bradley Nicholes Date: Thu, 4 Nov 2004 22:31:44 +0000 (+0000) Subject: Don't display the cache statistics if the node is empty X-Git-Tag: 2.0.53~189 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e7dc65e4fb337ededbff6541e85d1607f7ed0bd;p=thirdparty%2Fapache%2Fhttpd.git Don't display the cache statistics if the node is empty git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@105688 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/experimental/util_ldap_cache_mgr.c b/modules/experimental/util_ldap_cache_mgr.c index 10445021d2e..e9db9f43072 100644 --- a/modules/experimental/util_ldap_cache_mgr.c +++ b/modules/experimental/util_ldap_cache_mgr.c @@ -645,10 +645,12 @@ char *util_ald_cache_display(request_rec *r, util_ldap_state_t *st) "Last Bind" "\n", r ); - for (i=0; i < n->search_cache->size; ++i) { - for (p = n->search_cache->nodes[i]; p != NULL; p = p->next) { - - (*n->search_cache->display)(r, n->search_cache, p->payload); + if (n) { + for (i=0; i < n->search_cache->size; ++i) { + for (p = n->search_cache->nodes[i]; p != NULL; p = p->next) { + + (*n->search_cache->display)(r, n->search_cache, p->payload); + } } } ap_rputs("\n

\n", r); @@ -664,10 +666,12 @@ char *util_ald_cache_display(request_rec *r, util_ldap_state_t *st) "Result" "\n", r ); - for (i=0; i < n->compare_cache->size; ++i) { - for (p = n->compare_cache->nodes[i]; p != NULL; p = p->next) { - - (*n->compare_cache->display)(r, n->compare_cache, p->payload); + if (n) { + for (i=0; i < n->compare_cache->size; ++i) { + for (p = n->compare_cache->nodes[i]; p != NULL; p = p->next) { + + (*n->compare_cache->display)(r, n->compare_cache, p->payload); + } } } ap_rputs("\n

\n", r); @@ -680,10 +684,12 @@ char *util_ald_cache_display(request_rec *r, util_ldap_state_t *st) "Actual DN" "\n", r ); - for (i=0; i < n->dn_compare_cache->size; ++i) { - for (p = n->dn_compare_cache->nodes[i]; p != NULL; p = p->next) { - - (*n->dn_compare_cache->display)(r, n->dn_compare_cache, p->payload); + if (n) { + for (i=0; i < n->dn_compare_cache->size; ++i) { + for (p = n->dn_compare_cache->nodes[i]; p != NULL; p = p->next) { + + (*n->dn_compare_cache->display)(r, n->dn_compare_cache, p->payload); + } } } ap_rputs("\n

\n", r);