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:
parent
b0cc017e9e
commit
ea243c2f2f
@ -108,6 +108,12 @@ sub notes {
|
||||
$self->{_notes}->{$key};
|
||||
}
|
||||
|
||||
sub reset {
|
||||
my $self = shift;
|
||||
$self->{_notes} = undef;
|
||||
$self = $self->new;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
@ -118,6 +118,7 @@ sub disconnect {
|
||||
$self->log(LOGINFO,"click, disconnecting");
|
||||
$self->SUPER::disconnect(@_);
|
||||
$self->run_hooks("post-connection");
|
||||
$self->connection->reset;
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -59,6 +59,7 @@ sub disconnect {
|
||||
$self->log(LOGINFO,"click, disconnecting");
|
||||
$self->SUPER::disconnect(@_);
|
||||
$self->run_hooks("post-connection");
|
||||
$self->connection->reset;
|
||||
die "disconnect_tcpserver";
|
||||
}
|
||||
|
||||
|
1
qpsmtpd
1
qpsmtpd
@ -23,6 +23,7 @@ $qpsmtpd->load_plugins();
|
||||
$qpsmtpd->start_connection();
|
||||
$qpsmtpd->run();
|
||||
$qpsmtpd->run_hooks("post-connection");
|
||||
$qpsmtpd->connection->reset;
|
||||
|
||||
__END__
|
||||
|
||||
|
@ -312,6 +312,7 @@ while (1) {
|
||||
$qpsmtpd->run();
|
||||
|
||||
$qpsmtpd->run_hooks("post-connection");
|
||||
$qpsmtpd->connection->reset;
|
||||
exit; # child leaves
|
||||
}
|
||||
}
|
||||
|
@ -616,6 +616,7 @@ sub qpsmtpd_session {
|
||||
);
|
||||
$qpsmtpd->run();
|
||||
$qpsmtpd->run_hooks("post-connection");
|
||||
$qpsmtpd->connection->reset;
|
||||
};
|
||||
if ($@ !~ /^(disconnect_tcpserver|died while reading from STDIN)/) {
|
||||
warn("$@");
|
||||
|
Loading…
Reference in New Issue
Block a user