Fixes for early_talker under high_perf code

git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@409 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Matt Sergeant 2005-04-28 21:38:02 +00:00
parent cefae57394
commit a75f4a53e0

View File

@ -44,7 +44,7 @@ and terminating the SMTP connection.
=cut
use IO::Select;
use Time::HiRes ();
use warnings;
use strict;
@ -70,8 +70,16 @@ sub register {
sub connect_handler {
my ($self, $transaction) = @_;
my $qp = $self->qp;
my $end = Time::HiRes::time + $self->{_args}->{'wait'} ;
my $time;
for( $time = Time::HiRes::time; $time < $end && !length($qp->{line}) ; $time = Time::HiRes::time ) {
$qp->can_read($end-$time);
}
my $earlytalker = 0;
$earlytalker = 1 if $time < $end ;
if ($self->qp->can_read($self->{_args}->{'wait'})) {
if ($earlytalker) {
$self->log(LOGNOTICE, 'remote host started talking before we said hello');
if ($self->{_args}->{'defer-reject'}) {
$self->connection->notes('earlytalker', 1);