Author: vetinari
Date: Fri May  9 22:53:39 2008
New Revision: 896

Modified:
   trunk/lib/Qpsmtpd/PollServer.pm

Log:
add pre- and post-connection hooks to -async

Modified: trunk/lib/Qpsmtpd/PollServer.pm
==============================================================================
--- trunk/lib/Qpsmtpd/PollServer.pm     (original)
+++ trunk/lib/Qpsmtpd/PollServer.pm     Fri May  9 22:53:39 2008
@@ -55,6 +55,7 @@
     $self->{mode} = 'connect';
     $self->load_plugins;
     $self->load_logging;
+    $self->run_hooks("pre-connection");
     return $self;
 }
 
@@ -83,6 +84,7 @@
     };
     $self->{mode} = 'cmd';
     $self->{_extras} = {};
+    warn "resetting...\n";
 }
 
 sub respond {
@@ -147,6 +149,12 @@
     $self->close;
 }
 
+sub close {
+    my Qpsmtpd::PollServer $self = shift;
+    $self->run_hooks("post-connection");
+    $self->SUPER::close;
+}
+
 sub start_conversation {
     my Qpsmtpd::PollServer $self = shift;
     

Reply via email to