Fix timeout config warnings.
Fix alarm not being reset at end of while loop git-svn-id: https://svn.perl.org/qpsmtpd/trunk@342 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
4c44510191
commit
bfd609fb32
@ -429,8 +429,8 @@ sub data {
|
|||||||
|
|
||||||
my $header = Mail::Header->new(Modify => 0, MailFrom => "COERCE");
|
my $header = Mail::Header->new(Modify => 0, MailFrom => "COERCE");
|
||||||
|
|
||||||
|
my $timeout = $self->config('timeout');
|
||||||
while (defined($_ = $self->getline)) {
|
while (defined($_ = $self->getline($timeout))) {
|
||||||
$complete++, last if $_ eq ".\r\n";
|
$complete++, last if $_ eq ".\r\n";
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
@ -524,10 +524,8 @@ sub data {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub getline {
|
sub getline {
|
||||||
my $self = shift;
|
my ($self, $timeout) = @_;
|
||||||
|
|
||||||
my $timeout = $self->config('timeout');
|
|
||||||
|
|
||||||
alarm $timeout;
|
alarm $timeout;
|
||||||
my $line = <STDIN>; # default implementation
|
my $line = <STDIN>; # default implementation
|
||||||
alarm 0;
|
alarm 0;
|
||||||
|
@ -62,6 +62,7 @@ sub read_input {
|
|||||||
or $self->respond(502, "command unrecognized: '$_'");
|
or $self->respond(502, "command unrecognized: '$_'");
|
||||||
alarm $timeout;
|
alarm $timeout;
|
||||||
}
|
}
|
||||||
|
alarm(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub respond {
|
sub respond {
|
||||||
|
Loading…
Reference in New Issue
Block a user