From: eldy <> Date: Tue, 15 Jul 2003 22:59:44 +0000 (+0000) Subject: Geoip lookup is always done (as it should) on ip when ip is known, even if DNSLookup... X-Git-Tag: AWSTATS_5_7_BETA~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c55f3138824d73b9ddac6c58842be577408fcd2;p=thirdparty%2FAWStats.git Geoip lookup is always done (as it should) on ip when ip is known, even if DNSLookup is enabled and successfull. --- diff --git a/wwwroot/cgi-bin/plugins/geoip.pm b/wwwroot/cgi-bin/plugins/geoip.pm index e25055a6..3392359e 100644 --- a/wwwroot/cgi-bin/plugins/geoip.pm +++ b/wwwroot/cgi-bin/plugins/geoip.pm @@ -61,7 +61,7 @@ sub Init_geoip { else { $mode=Geo::IP::GEOIP_STANDARD(); } } %TmpDomainLookup=(); - debug(" GeoIP working in mode $mode",1); + debug(" GeoIP working in mode $type $mode",1); if ($type eq 'geoippureperl') { $gi = Geo::IP::PurePerl->new($mode); } else { @@ -84,9 +84,9 @@ sub GetCountryCodeByName_geoip { if (! $res) { $res=lc($gi->country_code_by_name($_[0])); $TmpDomainLookup{$_[0]}=$res; - if ($Debug) { debug(" GetCountryCodeByName for $_[0]: $res",5); } + if ($Debug) { debug(" GetCountryCodeByName for $_[0]: [$res]",5); } } - elsif ($Debug) { debug(" GetCountryCodeByName for $_[0]: Already resolved to $res",5); } + elsif ($Debug) { debug(" GetCountryCodeByName for $_[0]: Already resolved to $res",5); } return $res; # -----> } @@ -102,9 +102,9 @@ sub GetCountryCodeByAddr_geoip { if (! $res) { $res=lc($gi->country_code_by_addr($_[0])); $TmpDomainLookup{$_[0]}=$res; - if ($Debug) { debug(" GetCountryCodeByAddr for $_[0]: $res",5); } + if ($Debug) { debug(" GetCountryCodeByAddr for $_[0]: $res",5); } } - elsif ($Debug) { debug(" GetCountryCodeByAddr for $_[0]: Already resolved to $res",5); } + elsif ($Debug) { debug(" GetCountryCodeByAddr for $_[0]: Already resolved to $res",5); } return $res; # -----> } diff --git a/wwwroot/cgi-bin/plugins/geoipfree.pm b/wwwroot/cgi-bin/plugins/geoipfree.pm index 83b8b950..d499fa58 100644 --- a/wwwroot/cgi-bin/plugins/geoipfree.pm +++ b/wwwroot/cgi-bin/plugins/geoipfree.pm @@ -69,9 +69,9 @@ sub GetCountryCodeByName_geoipfree { if (! $res) { ($res,undef)=$gi->LookUp($_[0]); if ($res !~ /\w\w/) { $res='ip'; } $TmpDomainLookup{$_[0]}=$res; - if ($Debug) { debug(" GetCountryCodeByName for $_[0]: $res",5); } + if ($Debug) { debug(" GetCountryCodeByName for $_[0]: $res",5); } } - elsif ($Debug) { debug(" GetCountryCodeByName for $_[0]: Already resolved to $res",5); } + elsif ($Debug) { debug(" GetCountryCodeByName for $_[0]: Already resolved to $res",5); } return $res; # -----> } @@ -87,9 +87,9 @@ sub GetCountryCodeByAddr_geoipfree { if (! $res) { ($res,undef)=$gi->LookUp($_[0]); if ($res !~ /\w\w/) { $res='ip'; } $TmpDomainLookup{$_[0]}=$res; - if ($Debug) { debug(" GetCountryCodeByAddr for $_[0]: $res",5); } + if ($Debug) { debug(" GetCountryCodeByAddr for $_[0]: $res",5); } } - elsif ($Debug) { debug(" GetCountryCodeByAddr for $_[0]: Already resolved to $res",5); } + elsif ($Debug) { debug(" GetCountryCodeByAddr for $_[0]: Already resolved to $res",5); } return $res; # -----> }