diff --git a/Changes b/Changes index 45b6d99..3bfa060 100644 --- a/Changes +++ b/Changes @@ -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 ) diff --git a/plugins/count_unrecognized_commands b/plugins/count_unrecognized_commands index 2a1f7e4..f08e78b 100644 --- a/plugins/count_unrecognized_commands +++ b/plugins/count_unrecognized_commands @@ -25,17 +25,19 @@ sub register { $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.");