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:
parent
df1efdce73
commit
58f03e5787
@ -15,7 +15,7 @@ my $resolver;
|
|||||||
|
|
||||||
sub trace {
|
sub trace {
|
||||||
my $level = shift;
|
my $level = shift;
|
||||||
print ("[$$] dns lookup: @_") if $::DEBUG >= $level;
|
print STDERR ("[$$] dns lookup: @_") if $::DEBUG >= $level;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
@ -93,7 +93,7 @@ sub DESTROY {
|
|||||||
my $now = time;
|
my $now = time;
|
||||||
foreach my $host (@{$self->{hosts}}) {
|
foreach my $host (@{$self->{hosts}}) {
|
||||||
if (!$self->{results}{$host}) {
|
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);
|
$self->{callback}->("NXDOMAIN", $host);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ sub register {
|
|||||||
sub connect_handler {
|
sub connect_handler {
|
||||||
my ($self, $transaction) = @_;
|
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');
|
$self->log(LOGNOTICE, 'remote host started talking before we said hello');
|
||||||
if ($self->{_args}->{'defer-reject'}) {
|
if ($self->{_args}->{'defer-reject'}) {
|
||||||
$self->connection->notes('earlytalker', 1);
|
$self->connection->notes('earlytalker', 1);
|
||||||
|
5
qpsmtpd
5
qpsmtpd
@ -9,7 +9,8 @@ BEGIN {
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use vars qw($DEBUG);
|
use vars qw($DEBUG);
|
||||||
use FindBin;
|
use FindBin qw();
|
||||||
|
# TODO: need to make this taint friendly
|
||||||
use lib "$FindBin::Bin/lib";
|
use lib "$FindBin::Bin/lib";
|
||||||
use Danga::Socket;
|
use Danga::Socket;
|
||||||
use Danga::Client;
|
use Danga::Client;
|
||||||
@ -94,7 +95,7 @@ my $POLL = "with " . ($Danga::Socket::HaveEpoll ? "epoll()" :
|
|||||||
my $server;
|
my $server;
|
||||||
|
|
||||||
# Code for inetd/tcpserver mode
|
# Code for inetd/tcpserver mode
|
||||||
if ($ENV{REMOTE_HOST}) {
|
if ($ENV{REMOTE_HOST} or $ENV{TCPREMOTEHOST}) {
|
||||||
run_as_inetd();
|
run_as_inetd();
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user