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");
|
||||
|
||||
|
||||
while (defined($_ = $self->getline)) {
|
||||
my $timeout = $self->config('timeout');
|
||||
while (defined($_ = $self->getline($timeout))) {
|
||||
$complete++, last if $_ eq ".\r\n";
|
||||
$i++;
|
||||
|
||||
@ -524,10 +524,8 @@ sub data {
|
||||
}
|
||||
|
||||
sub getline {
|
||||
my $self = shift;
|
||||
my ($self, $timeout) = @_;
|
||||
|
||||
my $timeout = $self->config('timeout');
|
||||
|
||||
alarm $timeout;
|
||||
my $line = <STDIN>; # default implementation
|
||||
alarm 0;
|
||||
|
@ -62,6 +62,7 @@ sub read_input {
|
||||
or $self->respond(502, "command unrecognized: '$_'");
|
||||
alarm $timeout;
|
||||
}
|
||||
alarm(0);
|
||||
}
|
||||
|
||||
sub respond {
|
||||
|
Loading…
Reference in New Issue
Block a user