Author: msergeant
Date: Thu May 12 15:08:37 2005
New Revision: 418
Modified:
branches/high_perf/lib/Qpsmtpd.pm
Log:
Cache the hooks
Modified: branches/high_perf/lib/Qpsmtpd.pm
==============================================================================
--- branches/high_perf/lib/Qpsmtpd.pm (original)
+++ branches/high_perf/lib/Qpsmtpd.pm Thu May 12 15:08:37 2005
@@ -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;
}