From 104c8b171009ef6eda753080bcceee068171b16c Mon Sep 17 00:00:00 2001 From: Hanno Hecker Date: Sat, 10 May 2008 05:53:39 +0000 Subject: [PATCH] add pre- and post-connection hooks to -async git-svn-id: https://svn.perl.org/qpsmtpd/trunk@896 958fd67b-6ff1-0310-b445-bb7760255be9 --- lib/Qpsmtpd/PollServer.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Qpsmtpd/PollServer.pm b/lib/Qpsmtpd/PollServer.pm index 3992ccf..1c92b70 100644 --- a/lib/Qpsmtpd/PollServer.pm +++ b/lib/Qpsmtpd/PollServer.pm @@ -55,6 +55,7 @@ sub new { $self->{mode} = 'connect'; $self->load_plugins; $self->load_logging; + $self->run_hooks("pre-connection"); return $self; } @@ -83,6 +84,7 @@ sub reset_for_next_message { }; $self->{mode} = 'cmd'; $self->{_extras} = {}; + warn "resetting...\n"; } sub respond { @@ -147,6 +149,12 @@ sub disconnect { $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;