cvs commit: qpsmtpd/lib Qpsmtpd.pm

[email protected] (Matt Sergeant)
Newsgroups perl.cvs.qpsmtpd
Message-ID <[email protected]>
cvsuser     03/10/23 01:48:56

  Modified:    lib      Qpsmtpd.pm
  Log:
  Check for register() function after fixing plugin name (major speedup for
  persistent environments as previously queue/qmail-queue would be recompiled
  for every mail)
  
  Revision  Changes    Path
  1.28      +2 -3      qpsmtpd/lib/Qpsmtpd.pm
  
  Index: Qpsmtpd.pm
  ===================================================================
  RCS file: /cvs/public/qpsmtpd/lib/Qpsmtpd.pm,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -w -r1.27 -r1.28
  --- Qpsmtpd.pm	15 Sep 2003 10:50:27 -0000	1.27
  +++ Qpsmtpd.pm	23 Oct 2003 08:48:56 -0000	1.28
  @@ -103,9 +103,6 @@
   
       my $plugin_name = $plugin;
   
  -    # don't reload plugins if they are already loaded
  -    next if defined &{"Qpsmtpd::Plugin::${plugin_name}::register"};
  -    
       # Escape everything into valid perl identifiers
       $plugin_name =~ s/([^A-Za-z0-9_\/])/sprintf("_%2x",unpack("C",$1))/eg;
   
  @@ -117,6 +114,8 @@
   		       "::" . (length $2 ? sprintf("_%2x",unpack("C",$2)) : "")
   		      ]egx;
   
  +    # don't reload plugins if they are already loaded
  +    next if defined &{"Qpsmtpd::Plugin::${plugin_name}::register"};
   
       my $sub;
       open F, "$dir/$plugin" or die "could not open $dir/$plugin: $!";
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.