]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Geoip lookup is always done (as it should) on ip when ip is known, even if DNSLookup...
authoreldy <>
Tue, 15 Jul 2003 22:59:44 +0000 (22:59 +0000)
committereldy <>
Tue, 15 Jul 2003 22:59:44 +0000 (22:59 +0000)
wwwroot/cgi-bin/plugins/geoip.pm
wwwroot/cgi-bin/plugins/geoipfree.pm

index e25055a66415444baf319866cf6262424c370f5a..3392359e83ee54f4552bc4f9757cc8cf126c7bd1 100644 (file)
@@ -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;
        # ----->
 }
index 83b8b950c16694263ec3d04901ccecf3f5e528a7..d499fa587d3c2921aaf97db75584c8f4a1d84795 100644 (file)
@@ -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;
        # ----->
 }