]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Untangle CacheManager reports from log_fqdn
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 9 Jan 2009 02:16:41 +0000 (15:16 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 9 Jan 2009 02:16:41 +0000 (15:16 +1300)
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.

src/client_db.cc

index dc9b9dec19ca5b56b999744bea63b06526803f6c..709e305f2895dc29145de1746b0bfe6d8a66a723 100644 (file)
@@ -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",