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:
parent
cefae57394
commit
a75f4a53e0
@ -44,7 +44,7 @@ and terminating the SMTP connection.
|
|||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
use IO::Select;
|
use Time::HiRes ();
|
||||||
|
|
||||||
use warnings;
|
use warnings;
|
||||||
use strict;
|
use strict;
|
||||||
@ -70,8 +70,16 @@ sub register {
|
|||||||
|
|
||||||
sub connect_handler {
|
sub connect_handler {
|
||||||
my ($self, $transaction) = @_;
|
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');
|
$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);
|
||||||
|
Loading…
Reference in New Issue
Block a user