tweaks to make it work with tcpserver

the check_earlytalker fix was entirely wrong


git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@393 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Ask Bjørn Hansen 2005-03-09 00:28:49 +00:00
parent df1efdce73
commit 58f03e5787
3 changed files with 6 additions and 5 deletions

View File

@ -15,7 +15,7 @@ my $resolver;
sub trace {
my $level = shift;
print ("[$$] dns lookup: @_") if $::DEBUG >= $level;
print STDERR ("[$$] dns lookup: @_") if $::DEBUG >= $level;
}
sub new {
@ -93,7 +93,7 @@ sub DESTROY {
my $now = time;
foreach my $host (@{$self->{hosts}}) {
if (!$self->{results}{$host}) {
print "DNS timeout (presumably) looking for $host after " . ($now - $self->{start}) . " secs\n";
print STDERR "DNS timeout (presumably) looking for $host after " . ($now - $self->{start}) . " secs\n";
$self->{callback}->("NXDOMAIN", $host);
}
}

View File

@ -71,7 +71,7 @@ sub register {
sub connect_handler {
my ($self, $transaction) = @_;
if ($self->can_read($self->{_args}->{'wait'})) {
if ($self->qp->can_read($self->{_args}->{'wait'})) {
$self->log(LOGNOTICE, 'remote host started talking before we said hello');
if ($self->{_args}->{'defer-reject'}) {
$self->connection->notes('earlytalker', 1);

View File

@ -9,7 +9,8 @@ BEGIN {
use strict;
use vars qw($DEBUG);
use FindBin;
use FindBin qw();
# TODO: need to make this taint friendly
use lib "$FindBin::Bin/lib";
use Danga::Socket;
use Danga::Client;
@ -94,7 +95,7 @@ my $POLL = "with " . ($Danga::Socket::HaveEpoll ? "epoll()" :
my $server;
# Code for inetd/tcpserver mode
if ($ENV{REMOTE_HOST}) {
if ($ENV{REMOTE_HOST} or $ENV{TCPREMOTEHOST}) {
run_as_inetd();
exit(0);
}