Use a method for getting a line, so we can subclass it.
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@316 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
069c5a6835
commit
8c37005161
@ -429,11 +429,8 @@ sub data {
|
||||
|
||||
my $header = Mail::Header->new(Modify => 0, MailFrom => "COERCE");
|
||||
|
||||
my $timeout = $self->config('timeout');
|
||||
|
||||
alarm $timeout;
|
||||
|
||||
while (<STDIN>) {
|
||||
while (defined($_ = $self->getline)) {
|
||||
$complete++, last if $_ eq ".\r\n";
|
||||
$i++;
|
||||
|
||||
@ -481,8 +478,6 @@ sub data {
|
||||
$size += length $_;
|
||||
}
|
||||
#$self->log(LOGDEBUG, "size is at $size\n") unless ($i % 300);
|
||||
|
||||
alarm $timeout;
|
||||
}
|
||||
|
||||
$self->log(LOGDEBUG, "max_size: $max_size / size: $size");
|
||||
@ -528,6 +523,17 @@ sub data {
|
||||
|
||||
}
|
||||
|
||||
sub getline {
|
||||
my $self = shift;
|
||||
|
||||
my $timeout = $self->config('timeout');
|
||||
|
||||
alarm $timeout;
|
||||
my $line = <STDIN>; # default implementation
|
||||
alarm 0;
|
||||
return $line;
|
||||
}
|
||||
|
||||
sub queue {
|
||||
my ($self, $transaction) = @_;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user