removed hook_connect, unnecessary.
---
plugins/count_unrecognized_commands | 29 +
1 file changed, 9 insertions(+), 20 deletions(-)
diff --git a/plugins/count_unrecognized_commands
b/plugins/count_unrecognized_commands
index 445dca7..1c3cbf2 100644
--- a/plugins/cou
On Jun 3, 2012, at 19:00, Matt Simerson wrote:
> removed hook_connect, unnecessary.
I think it's there so if you log or otherwise use the note, it'll be reasonably
initialized.
> - if ($badcmdcount >= $self->{_unrec_cmd_max}) {
> -my $msg = "Closing connection, $badcmdcount unrecognized c
On Jun 3, 2012, at 11:41 PM, Ask Bjørn Hansen wrote:
>
> On Jun 3, 2012, at 19:00, Matt Simerson wrote:
>
>> removed hook_connect, unnecessary.
>
> I think it's there so if you log or otherwise use the note, it'll be
> reasonably initialized.
It's not used anywhere else in qpsmtpd or plugins
The bad news: I did introduce a bug.
The good news: My tests caught it. Travis complained.
Pull Request: https://github.com/smtpd/qpsmtpd/pull/27
Details:
This code does not increment $count correctly:
+my $count = $self->connection->notes('unrec_cmd_count') || 0 + 1;
+
On Mon, 4 Jun 2012, Matt Simerson wrote:
> +my $count = $self->connection->notes('unrec_cmd_count') || 0;
> + $self->connection->notes('unrec_cmd_count',
> ++$count );
>
> Which does increment correctly.
>
> This also works (note the parens), which is how it was d
On Jun 4, 2012, at 7:35 PM, Charlie Brady wrote:
>
> On Mon, 4 Jun 2012, Matt Simerson wrote:
>
>> +my $count = $self->connection->notes('unrec_cmd_count') || 0;
>> + $self->connection->notes('unrec_cmd_count',
>> ++$count );
>>
>> Which does increment correctly.