From: Amos Jeffries Date: Tue, 6 Jan 2009 13:13:44 +0000 (+1300) Subject: Untangle CacheManager reports from log_fqdn X-Git-Tag: SQUID_3_2_0_1~1277 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c63e5f01514cbc26e4cf0bea75d2134e8c7916d2;p=thirdparty%2Fsquid.git Untangle CacheManager reports from log_fqdn The fqdnFromAddr() call depends on log_fqdn to generate the FQDN. But CacheManager needs to always display it whenever available. This removes the call indirection, dependency and makes Name: field only display when a name is available. see Bug 2557 for more details. --- diff --git a/src/client_db.cc b/src/client_db.cc index dc9b9dec19..709e305f28 100644 --- a/src/client_db.cc +++ b/src/client_db.cc @@ -229,10 +229,10 @@ log_type &operator++ (log_type &aLogType) return aLogType; } - void clientdbDump(StoreEntry * sentry) { + const char *name; ClientInfo *c; log_type l; int icp_total = 0; @@ -244,7 +244,9 @@ clientdbDump(StoreEntry * sentry) while ((c = (ClientInfo *) hash_next(client_table))) { storeAppendPrintf(sentry, "Address: %s\n", hashKeyStr(&c->hash)); - storeAppendPrintf(sentry, "Name: %s\n", fqdnFromAddr(c->addr)); + if( (name = fqdncache_gethostbyaddr(c->addr, 0)) ) { + storeAppendPrintf(sentry, "Name: %s\n", name); + } storeAppendPrintf(sentry, "Currently established connections: %d\n", c->n_established); storeAppendPrintf(sentry, " ICP Requests %d\n",