From 245bdd1acf586e0f7a00b4d70e9e5eb6ac20dd36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ask=20Bj=C3=B8rn=20Hansen?= Date: Tue, 6 Aug 2002 12:57:02 +0000 Subject: [PATCH] make the alarm{timeout} thing slightly more efficient... git-svn-id: https://svn.perl.org/qpsmtpd/branches/v010@41 958fd67b-6ff1-0310-b445-bb7760255be9 --- lib/Qpsmtpd.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Qpsmtpd.pm b/lib/Qpsmtpd.pm index 958126d..1718144 100644 --- a/lib/Qpsmtpd.pm +++ b/lib/Qpsmtpd.pm @@ -305,6 +305,8 @@ sub data { my $header = Mail::Header->new(Modify => 0, MailFrom => "COERCE"); + my $timeout = $self->config('timeout'); + while () { $complete++, last if $_ eq ".\r\n"; $i++; @@ -341,7 +343,7 @@ sub data { } $self->log(5, "size is at $size\n") unless ($i % 300); - alarm $self->config('timeout'); + alarm $timeout; } $self->log(6, "max_size: $max_size / size: $size");