cvs commit: qpsmtpd/lib/Qpsmtpd SelectServer.pm

[email protected] (Matt Sergeant)
Newsgroups perl.cvs.qpsmtpd
Message-ID <[email protected]>
cvsuser     03/11/19 15:01:43

  Modified:    lib/Qpsmtpd SelectServer.pm
  Log:
  Override log function to use fileno(client) as pid will always be the same
  Don't use exit() in response to bad LF end of DATA
  
  Revision  Changes    Path
  1.7       +11 -3     qpsmtpd/lib/Qpsmtpd/SelectServer.pm
  
  Index: SelectServer.pm
  ===================================================================
  RCS file: /cvs/public/qpsmtpd/lib/Qpsmtpd/SelectServer.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -w -r1.6 -r1.7
  --- SelectServer.pm	6 Nov 2003 15:41:03 -0000	1.6
  +++ SelectServer.pm	19 Nov 2003 23:01:43 -0000	1.7
  @@ -27,6 +27,12 @@
   
   $SIG{INT} = $SIG{TERM} = sub { $QUIT++ };
   
  +sub log {
  +  my ($self, $trace, @log) = @_;
  +  warn join(" ", fileno($self->client), @log), "\n"
  +    if $trace <= Qpsmtpd::TRACE_LEVEL();
  +}
  +
   sub main {
       my $class = shift;
       my %opts = (LocalPort => 25, Reuse => 1, Listen => SOMAXCONN, @_);
  @@ -272,9 +278,11 @@
         # DATA is always the end of a "transaction"
         return $self->reset_transaction;
     }
  -  
  -  $self->respond(451, "See http://develooper.com/code/qpsmtpd/barelf.html"), exit
  -      if $_ eq ".\n";
  +  elsif ($_ eq ".\n") {
  +    $self->respond(451, "See http://develooper.com/code/qpsmtpd/barelf.html");
  +    $self->{__quitting} = 1;
  +    return;
  +  }
     
     # add a transaction->blocked check back here when we have line by line plugin access...
     unless (($self->{__max_size} and $self->{__size} > $self->{__max_size})) {
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.