On Jun 4, 2012, at 9:32 AM, Charlie Brady wrote:
> On Sun, 3 Jun 2012, Matt Simerson wrote:
>
>> ---
>> plugins/connection_time | 18 ++++++++++++++----
>> 1 file changed, 14 insertions(+), 4 deletions(-)
>>
>> diff --git a/plugins/connection_time b/plugins/connection_time
>> index bfac4d2..9cff7f9 100644
>> --- a/plugins/connection_time
>> +++ b/plugins/connection_time
>> @@ -26,9 +26,10 @@ Adjust the quantity of logging for this plugin. See
>> docs/logging.pod
>> use strict;
>> use warnings;
>>
>> -use Time::HiRes qw(gettimeofday tv_interval);
>> use Qpsmtpd::Constants;
>>
>> +use Time::HiRes qw(gettimeofday tv_interval);
>> +
>
> Is the change in ordering here accidental, gratuitous, or is there some
> hidden functional significance?
No functional significance. Except where functionality matters, I have been
ordering them in all plugins as:
pragma declarations
local dependencies
external dependencies
and in alphabetical order, within the dependency groups.
>> sub register {
>> my ($self, $qp) = shift, shift;
>> if ( @_ == 1 ) { # backwards compatible
>> @@ -43,18 +44,27 @@ sub register {
>> }
>> else {
>> $self->{_args} = { @_ }; # named args, inherits loglevel
>> - }
>> + };
>> }
>>
>> sub hook_pre_connection {
>> - my ($self, @foo) = @_;
>> + my $self = shift;
>> + $self->{_connection_start} = [gettimeofday];
>> + $self->log(LOGDEBUG, "started at " . $self->{_connection_start} );
>> + return (DECLINED);
>> +}
>> +
>> +sub hook_connect {
>> + my $self = shift;
>> +# this method is needed to function with the tcpserver deployment model
>> + return (DECLINED) if defined $self->{_connection_start};
>> $self->{_connection_start} = [gettimeofday];
>> $self->log(LOGDEBUG, "started at " . $self->{_connection_start} );
>> return (DECLINED);
>> }
>>
>> sub hook_post_connection {
>> - my ($self, @foo) = @_;
>> + my $self = shift;
>>
>> if ( ! $self->{_connection_start} ) {
>> $self->log(LOGERROR, "Start time not set?!");
>>