add reset() to Qpsmtpd::Connection to clear the connection notes after

the post-connection hooks - needed for -prefork and STARTTLS


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@893 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Hanno Hecker 2008-05-09 17:40:31 +00:00
parent b0cc017e9e
commit ea243c2f2f
6 changed files with 11 additions and 0 deletions

View File

@ -108,6 +108,12 @@ sub notes {
$self->{_notes}->{$key}; $self->{_notes}->{$key};
} }
sub reset {
my $self = shift;
$self->{_notes} = undef;
$self = $self->new;
}
1; 1;
__END__ __END__

View File

@ -118,6 +118,7 @@ sub disconnect {
$self->log(LOGINFO,"click, disconnecting"); $self->log(LOGINFO,"click, disconnecting");
$self->SUPER::disconnect(@_); $self->SUPER::disconnect(@_);
$self->run_hooks("post-connection"); $self->run_hooks("post-connection");
$self->connection->reset;
exit; exit;
} }

View File

@ -59,6 +59,7 @@ sub disconnect {
$self->log(LOGINFO,"click, disconnecting"); $self->log(LOGINFO,"click, disconnecting");
$self->SUPER::disconnect(@_); $self->SUPER::disconnect(@_);
$self->run_hooks("post-connection"); $self->run_hooks("post-connection");
$self->connection->reset;
die "disconnect_tcpserver"; die "disconnect_tcpserver";
} }

View File

@ -23,6 +23,7 @@ $qpsmtpd->load_plugins();
$qpsmtpd->start_connection(); $qpsmtpd->start_connection();
$qpsmtpd->run(); $qpsmtpd->run();
$qpsmtpd->run_hooks("post-connection"); $qpsmtpd->run_hooks("post-connection");
$qpsmtpd->connection->reset;
__END__ __END__

View File

@ -312,6 +312,7 @@ while (1) {
$qpsmtpd->run(); $qpsmtpd->run();
$qpsmtpd->run_hooks("post-connection"); $qpsmtpd->run_hooks("post-connection");
$qpsmtpd->connection->reset;
exit; # child leaves exit; # child leaves
} }
} }

View File

@ -616,6 +616,7 @@ sub qpsmtpd_session {
); );
$qpsmtpd->run(); $qpsmtpd->run();
$qpsmtpd->run_hooks("post-connection"); $qpsmtpd->run_hooks("post-connection");
$qpsmtpd->connection->reset;
}; };
if ($@ !~ /^(disconnect_tcpserver|died while reading from STDIN)/) { if ($@ !~ /^(disconnect_tcpserver|died while reading from STDIN)/) {
warn("$@"); warn("$@");