cvs commit: qpsmtpd/plugins count_unrecognized_commands

[email protected] (Ask "Bj?rn" Hansen)
Newsgroups perl.cvs.qpsmtpd
Message-ID <[email protected]>
cvsuser     04/03/03 20:14:09

  Modified:    .        Changes
               plugins  count_unrecognized_commands
  Log:
    Bugfix to the count_unrecognized_commands plugin so it works
    under PPerl (it wasn't resetting the count properly).
  
  Revision  Changes    Path
  1.58      +3 -0      qpsmtpd/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /cvs/public/qpsmtpd/Changes,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -w -r1.57 -r1.58
  --- Changes	24 Feb 2004 10:31:11 -0000	1.57
  +++ Changes	4 Mar 2004 04:14:09 -0000	1.58
  @@ -1,5 +1,8 @@
   0.27 
   
  +  Bugfix to the count_unrecognized_commands plugin so it works
  +  under PPerl (it wasn't resetting the count properly).
  +
     reset_transaction is called after disconnect plugins are called so
     the Transaction objects DESTROY method is called. (Thanks to Robert
     James Kaes <[email protected]>)
  
  
  
  1.2       +7 -5      qpsmtpd/plugins/count_unrecognized_commands
  
  Index: count_unrecognized_commands
  ===================================================================
  RCS file: /cvs/public/qpsmtpd/plugins/count_unrecognized_commands,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -r1.1 -r1.2
  --- count_unrecognized_commands	15 Apr 2003 17:39:03 -0000	1.1
  +++ count_unrecognized_commands	4 Mar 2004 04:14:09 -0000	1.2
  @@ -25,17 +25,19 @@
       $self->{_unrec_cmd_max} = 4;
     }
   
  -  $self->{_unrec_cmd_count} = 0;
  +  $qp->connection->notes('unrec_cmd_count', 0);
  +
   }
   
   sub check_unrec_cmd {
  -  my ($self, $transaction, $cmd) = @_;
  +  my ($self, $cmd) = @_[0,2];
     
     $self->log(5, "Unrecognized command '$cmd'");
   
  -  $self->{_unrec_cmd_count}++;
  -
  -  my $badcmdcount = $self->{_unrec_cmd_count};
  +  my $badcmdcount = 
  +    $self->qp->connection->notes('unrec_cmd_count',
  +				 $self->qp->connection->notes('unrec_cmd_count') + 1
  +				);
   
     if ($badcmdcount >= $self->{_unrec_cmd_max}) {
       $self->log(5, "Closing connection. Too many unrecognized commands.");
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.