From: eldy <> Date: Sat, 2 Aug 2003 22:48:17 +0000 (+0000) Subject: Fix not working country detection with DNSLookup=1 and no geoip plugin. X-Git-Tag: AWSTATS_5_7_BETA~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7fc3d54a25a4f18bbede214ccf7771d2662aa0b3;p=thirdparty%2FAWStats.git Fix not working country detection with DNSLookup=1 and no geoip plugin. --- diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index 72128d3e..97a313ad 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -5626,6 +5626,7 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') { # Updat # Analyze: Country (Top-level domain) #------------------------------------ + if ($Debug) { debug(" Search country (Host=$Host HostResolved=$HostResolved ip=$ip)",4); } my $Domain='ip'; # Set $HostResolved to host and resolve domain if ($HostResolved eq '*') { @@ -5642,6 +5643,7 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') { # Updat if ($ip) { if ($PluginsLoaded{'GetCountryCodeByAddr'}{'geoipfree'}) { $Domain=GetCountryCodeByAddr_geoipfree($Host); } elsif ($PluginsLoaded{'GetCountryCodeByAddr'}{'geoip'}) { $Domain=GetCountryCodeByAddr_geoip($Host); } + elsif ($HostResolved =~ /\.(\w+)$/) { $Domain=$1; } } else { if ($PluginsLoaded{'GetCountryCodeByName'}{'geoipfree'}) { $Domain=GetCountryCodeByName_geoipfree($HostResolved); }