More small performance optimisations
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@841 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
5f6d3dba0d
commit
3553eee269
@ -291,7 +291,7 @@ sub load_plugins {
|
||||
my @loaded;
|
||||
|
||||
if ($hooks->{queue}) {
|
||||
$self->log(LOGWARN, "Plugins already loaded");
|
||||
#$self->log(LOGWARN, "Plugins already loaded");
|
||||
return @plugins;
|
||||
}
|
||||
|
||||
@ -412,13 +412,9 @@ sub run_continuation {
|
||||
my $code = shift @$todo;
|
||||
#my $t2 = $SAMPLER->($hook . "_" . $code->{name}, undef, 1);
|
||||
#warn("Got sampler called: ${hook}_$code->{name}\n");
|
||||
if ( $hook eq 'logging' ) { # without calling $self->log()
|
||||
eval { (@r) = $code->{code}->($self, $self->transaction, @$args); };
|
||||
$@ and warn("FATAL LOGGING PLUGIN ERROR: ", $@) and next;
|
||||
}
|
||||
else {
|
||||
$self->varlog(LOGDEBUG, $hook, $code->{name});
|
||||
eval { (@r) = $code->{code}->($self, $self->transaction, @$args); };
|
||||
my $tran = $self->transaction;
|
||||
eval { (@r) = $code->{code}->($self, $tran, @$args); };
|
||||
$@ and $self->log(LOGCRIT, "FATAL PLUGIN ERROR: ", $@) and next;
|
||||
|
||||
!defined $r[0]
|
||||
@ -426,8 +422,10 @@ sub run_continuation {
|
||||
." running the $hook hook returned undef!")
|
||||
and next;
|
||||
|
||||
if ($self->transaction) {
|
||||
my $tnotes = $self->transaction->notes( $code->{name} );
|
||||
# note this is wrong as $tran is always true in the
|
||||
# current code...
|
||||
if ($tran) {
|
||||
my $tnotes = $tran->notes( $code->{name} );
|
||||
$tnotes->{"hook_$hook"}->{'return'} = $r[0]
|
||||
if (!defined $tnotes || ref $tnotes eq "HASH");
|
||||
}
|
||||
@ -457,8 +455,6 @@ sub run_continuation {
|
||||
$self->run_hooks_no_respond("ok", $code->{name}, $r[0], $r[1]) unless ($hook eq "ok");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
last unless $r[0] == DECLINED;
|
||||
}
|
||||
$r[0] = DECLINED if not defined $r[0];
|
||||
|
Loading…
Reference in New Issue
Block a user