Oops, got the wrong end of the socket for the IP address!

git-svn-id: https://svn.perl.org/qpsmtpd/trunk@190 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Matt Sergeant 2003-11-03 08:22:24 +00:00
parent ba12debf5f
commit eff5e69d39

View File

@ -46,17 +46,14 @@ sub main {
my $client_addr; my $client_addr;
$client = $server->accept(); $client = $server->accept();
next unless $client; next unless $client;
my $ip = $client->sockhost; my $ip = $client->peerhost;
#my $revip = join('.', reverse(split(/\./, $ip)));
#print "Looking up: $revip.in-addr.arpa\n";
#my $bgsock = $res->bgsend("$revip.in-addr.arpa", 'PTR');
my $bgsock = $res->bgsend($ip); my $bgsock = $res->bgsend($ip);
$select->add($bgsock); $select->add($bgsock);
$lookup{$bgsock} = $client; $lookup{$bgsock} = $client;
} }
elsif (my $qpclient = $lookup{$client}) { elsif (my $qpclient = $lookup{$client}) {
my $packet = $res->bgread($client); my $packet = $res->bgread($client);
my $ip = $qpclient->sockhost; my $ip = $qpclient->peerhost;
my $hostname = $ip; my $hostname = $ip;
if ($packet) { if ($packet) {
foreach my $rr ($packet->answer) { foreach my $rr ($packet->answer) {