]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Fix a bad use of cache if geoip failed.
authoreldy <>
Tue, 23 Aug 2005 20:14:06 +0000 (20:14 +0000)
committereldy <>
Tue, 23 Aug 2005 20:14:06 +0000 (20:14 +0000)
wwwroot/cgi-bin/plugins/geoip.pm

index 707f832ed9f1633be581015026f3a25445e2ed1b..89d522864c222cb2a03c2e4abbcf28c8a32d3a3f 100644 (file)
@@ -86,7 +86,7 @@ sub GetCountryCodeByName_geoip {
        my $res=$TmpDomainLookup{$param}||'';
        if (! $res) {
                $res=lc($gi->country_code_by_name($param));
-               $TmpDomainLookup{$param}=$res;
+               $TmpDomainLookup{$param}=$res || 'unknown';
                if ($Debug) { debug("  Plugin geoip: GetCountryCodeByName for $param: [$res]",5); }
        }
        elsif ($Debug) { debug("  Plugin geoip: GetCountryCodeByName for $param: Already resolved to $res",5); }
@@ -105,7 +105,7 @@ sub GetCountryCodeByAddr_geoip {
        my $res=$TmpDomainLookup{$param}||'';
        if (! $res) {
                $res=lc($gi->country_code_by_addr($param));
-               $TmpDomainLookup{$param}=$res;
+               $TmpDomainLookup{$param}=$res || 'unknown';
                if ($Debug) { debug("  Plugin geoip: GetCountryCodeByAddr for $param: $res",5); }
        }
        elsif ($Debug) { debug("  Plugin geoip: GetCountryCodeByAddr for $param: Already resolved to $res",5); }