cvs commit: qpsmtpd/lib/Qpsmtpd SMTP.pm

[email protected] (Matt Sergeant)
Newsgroups perl.cvs.qpsmtpd
Message-ID <[email protected]>
cvsuser     04/09/13 22:48:39

  Modified:    lib/Qpsmtpd SMTP.pm
  Log:
  Use a method for getting a line, so we can subclass it.
  
  Revision  Changes    Path
  1.42      +12 -6     qpsmtpd/lib/Qpsmtpd/SMTP.pm
  
  Index: SMTP.pm
  ===================================================================
  RCS file: /cvs/public/qpsmtpd/lib/Qpsmtpd/SMTP.pm,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -w -r1.41 -r1.42
  --- SMTP.pm	7 Sep 2004 15:08:26 -0000	1.41
  +++ SMTP.pm	14 Sep 2004 05:48:39 -0000	1.42
  @@ -429,11 +429,8 @@
   
     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 @@
         $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 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) = @_;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.