Author: vetinari
Date: Fri May 9 10:40:31 2008
New Revision: 893
Modified:
trunk/lib/Qpsmtpd/Connection.pm
trunk/lib/Qpsmtpd/TcpServer.pm
trunk/lib/Qpsmtpd/TcpServer/Prefork.pm
trunk/qpsmtpd
trunk/qpsmtpd-forkserver
trunk/qpsmtpd-prefork
Log:
add reset() to Qpsmtpd::Connection to clear the connection notes after
the post-connection hooks - needed for -prefork and STARTTLS
Modified: trunk/lib/Qpsmtpd/Connection.pm
==============================================================================
--- trunk/lib/Qpsmtpd/Connection.pm (original)
+++ trunk/lib/Qpsmtpd/Connection.pm Fri May 9 10:40:31 2008
@@ -108,6 +108,12 @@
$self->{_notes}->{$key};
}
+sub reset {
+ my $self = shift;
+ $self->{_notes} = undef;
+ $self = $self->new;
+}
+
1;
__END__
Modified: trunk/lib/Qpsmtpd/TcpServer.pm
==============================================================================
--- trunk/lib/Qpsmtpd/TcpServer.pm (original)
+++ trunk/lib/Qpsmtpd/TcpServer.pm Fri May 9 10:40:31 2008
@@ -118,6 +118,7 @@
$self->log(LOGINFO,"click, disconnecting");
$self->SUPER::disconnect(@_);
$self->run_hooks("post-connection");
+ $self->connection->reset;
exit;
}
Modified: trunk/lib/Qpsmtpd/TcpServer/Prefork.pm
==============================================================================
--- trunk/lib/Qpsmtpd/TcpServer/Prefork.pm (original)
+++ trunk/lib/Qpsmtpd/TcpServer/Prefork.pm Fri May 9 10:40:31 2008
@@ -59,6 +59,7 @@
$self->log(LOGINFO,"click, disconnecting");
$self->SUPER::disconnect(@_);
$self->run_hooks("post-connection");
+ $self->connection->reset;
die "disconnect_tcpserver";
}
Modified: trunk/qpsmtpd
==============================================================================
--- trunk/qpsmtpd (original)
+++ trunk/qpsmtpd Fri May 9 10:40:31 2008
@@ -23,6 +23,7 @@
$qpsmtpd->start_connection();
$qpsmtpd->run();
$qpsmtpd->run_hooks("post-connection");
+$qpsmtpd->connection->reset;
__END__
Modified: trunk/qpsmtpd-forkserver
==============================================================================
--- trunk/qpsmtpd-forkserver (original)
+++ trunk/qpsmtpd-forkserver Fri May 9 10:40:31 2008
@@ -312,6 +312,7 @@
$qpsmtpd->run();
$qpsmtpd->run_hooks("post-connection");
+ $qpsmtpd->connection->reset;
exit; # child leaves
}
}
Modified: trunk/qpsmtpd-prefork
==============================================================================
--- trunk/qpsmtpd-prefork (original)
+++ trunk/qpsmtpd-prefork Fri May 9 10:40:31 2008
@@ -616,6 +616,7 @@
);
$qpsmtpd->run();
$qpsmtpd->run_hooks("post-connection");
+ $qpsmtpd->connection->reset;
};
if ($@ !~ /^(disconnect_tcpserver|died while reading from STDIN)/) {
warn("$@");