Recreate the Geo::IP object for each message. (Otherwise it will hold the underlying database file handle open, and it doesn't like when that file changes underneath it.)

git-svn-id: https://svn.perl.org/qpsmtpd/trunk@933 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Robert Spier 2008-07-04 02:03:56 +00:00 committed by Ask Bjørn Hansen
parent d5c81c31d8
commit 29ea951680

View File

@ -15,11 +15,10 @@ or greylist.
use Geo::IP;
my $geoip = Geo::IP->new(GEOIP_STANDARD);
sub hook_connect {
my ($self) = @_;
my $geoip = Geo::IP->new(GEOIP_STANDARD);
my $country =
$geoip->country_code_by_addr( $self->qp->connection->remote_ip );