adjust logging. enable disconnect_handler again.

git-svn-id: https://svn.perl.org/qpsmtpd/trunk@72 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Ask Bjørn Hansen 2002-09-10 16:49:10 +00:00
parent 9916cfc038
commit 21a88f9f54

View File

@ -3,7 +3,7 @@ sub register {
my ($self, $qp) = @_; my ($self, $qp) = @_;
$self->register_hook("connect", "connect_handler"); $self->register_hook("connect", "connect_handler");
$self->register_hook("rcpt", "rcpt_handler"); $self->register_hook("rcpt", "rcpt_handler");
#$self->register_hook("disconnect", "disconnect_handler"); $self->register_hook("disconnect", "disconnect_handler");
} }
sub connect_handler { sub connect_handler {
@ -23,7 +23,7 @@ sub connect_handler {
my $sel = IO::Select->new(); my $sel = IO::Select->new();
for my $dnsbl (keys %dnsbl_zones) { for my $dnsbl (keys %dnsbl_zones) {
$self->log(5, "Checking $reversed_ip.$dnsbl in the background"); $self->log(7, "Checking $reversed_ip.$dnsbl in the background");
$sel->add($res->bgsend("$reversed_ip.$dnsbl", "TXT")); $sel->add($res->bgsend("$reversed_ip.$dnsbl", "TXT"));
} }
@ -45,12 +45,12 @@ sub process_sockets {
my $result; my $result;
$self->log(6, "waiting for dnsbl dns"); $self->log(8, "waiting for dnsbl dns");
# don't wait more than 5 seconds here # don't wait more than 5 seconds here
my @ready = $sel->can_read(5); my @ready = $sel->can_read(5);
$self->log(6, "DONE waiting for dnsbl dns"); $self->log(8, "DONE waiting for dnsbl dns, got " , scalar @ready, " answers ...") ;
for my $socket (@ready) { for my $socket (@ready) {
my $query = $res->bgread($socket); my $query = $res->bgread($socket);
@ -98,9 +98,7 @@ sub rcpt_handler {
sub disconnect_handler { sub disconnect_handler {
my ($self, $transaction) = @_; my ($self, $transaction) = @_;
my $sockets = $self->qp->connection->notes('dnsbl_sockets'); $self->qp->connection->notes('dnsbl_sockets', undef);
# if there were more to read; then forget about them again ...
undef $_ for (@{$sockets});
return DECLINED; return DECLINED;
} }