From: eldy <> Date: Sat, 19 Mar 2005 20:30:23 +0000 (+0000) Subject: Fix: Dying process with geoip_city plugin when IP is unknown by plugin. X-Git-Tag: AWSTATS_WEBMIN_1_6_BETA~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac01262f5026851f4150af16b2cc1aa92ada663a;p=thirdparty%2FAWStats.git Fix: Dying process with geoip_city plugin when IP is unknown by plugin. --- diff --git a/wwwroot/cgi-bin/plugins/geoip_city_maxmind.pm b/wwwroot/cgi-bin/plugins/geoip_city_maxmind.pm index 5324056f..b32df336 100755 --- a/wwwroot/cgi-bin/plugins/geoip_city_maxmind.pm +++ b/wwwroot/cgi-bin/plugins/geoip_city_maxmind.pm @@ -4500,17 +4500,21 @@ sub SectionProcessIp_geoip_city_maxmind { my $record=(); $record=$geoip_city_maxmind->record_by_addr($param) if $geoip_city_maxmind; if ($Debug) { debug(" Plugin geoip_city_maxmind: GetCityByIp for $param: [$record]",5); } - my $city=$record->city; -# if ($PageBool) { $_city_p{$city}++; } - if ($city) { - my $countrycity=($record->country_code).'_'.$city; - $countrycity=~s/ /%20/g; - if ($record->region) { $countrycity.='_'.$record->region; } - $_city_h{lc($countrycity)}++; + if ($record) { + my $city=$record->city; +# if ($PageBool) { $_city_p{$city}++; } + if ($city) { + my $countrycity=($record->country_code).'_'.$city; + $countrycity=~s/ /%20/g; + if ($record->region) { $countrycity.='_'.$record->region; } + $_city_h{lc($countrycity)}++; + } else { + $_city_h{'unknown'}++; + } +# if ($timerecord > $_city_l{$city}) { $_city_l{$city}=$timerecord; } } else { $_city_h{'unknown'}++; } -# if ($timerecord > $_city_l{$city}) { $_city_l{$city}=$timerecord; } # -----> return; }