From: eldy <> Date: Sat, 27 Nov 2004 14:32:00 +0000 (+0000) Subject: Fix bug [ 1064676 ] wrong replacement of unresolved ip in logresolvemerge.pl X-Git-Tag: AWSTATS_6_3_RELEASE~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6499ef4e1fde12380e2ca2ec5c6f320530f2653;p=thirdparty%2FAWStats.git Fix bug [ 1064676 ] wrong replacement of unresolved ip in logresolvemerge.pl --- diff --git a/tools/logresolvemerge.pl b/tools/logresolvemerge.pl index 97e23c4b..cef42f81 100644 --- a/tools/logresolvemerge.pl +++ b/tools/logresolvemerge.pl @@ -379,8 +379,10 @@ if ($DNSCache) { open(CACHE, "<$DNSCache") or error("Can't open cache file $DNSCache"); while () { my ($time, $ip, $name) = split; - $name='ip' if $name eq '*'; - $MyDNSTable{$ip}=$name; + if ($ip && $name) { + $name="$ip" if $name eq '*'; + $MyDNSTable{$ip}=$name; + } } close CACHE; } @@ -502,8 +504,8 @@ while (1 == 1) # END Read new lines for each log file. After this, following var are filled # $timerecord{$logfilenb} - # We choose wich record of wich log file to process - if ($Debug) { debug("Choose of wich record of which log file to process",3); } + # We choose which record of which log file to process + if ($Debug) { debug("Choose which record of which log file to process",3); } $logfilechosen=-1; my $timeref="99999999999999"; foreach my $logfilenb (keys %LogFileToDo) {