From 37c96a17734f374e156e7c9e8bd0c30c28afe1d0 Mon Sep 17 00:00:00 2001 From: Matt Sergeant Date: Thu, 12 May 2005 22:08:37 +0000 Subject: [PATCH] Cache the hooks git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@418 958fd67b-6ff1-0310-b445-bb7760255be9 --- lib/Qpsmtpd.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/Qpsmtpd.pm b/lib/Qpsmtpd.pm index d8593d8..6d07d20 100644 --- a/lib/Qpsmtpd.pm +++ b/lib/Qpsmtpd.pm @@ -122,9 +122,15 @@ sub _config_from_file { return wantarray ? @config : $config[0]; } +our $HOOKS; + sub load_plugins { my $self = shift; - + + if ($HOOKS) { + return $self->{hooks} = $HOOKS; + } + $self->log(LOGERROR, "Plugins already loaded") if $self->{hooks}; $self->{hooks} = {}; @@ -135,6 +141,8 @@ sub load_plugins { @plugins = $self->_load_plugins($dir, @plugins); + $HOOKS = $self->{hooks}; + return @plugins; }