reset the original connection object like we reset all connection objects at the end of a connection

git-svn-id: https://svn.perl.org/qpsmtpd/trunk@913 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Hanno Hecker 2008-05-18 05:55:30 +00:00 committed by Ask Bjørn Hansen
parent d7ef2ac660
commit a05b334b44

View File

@ -38,10 +38,15 @@ sub start {
sub clone {
my $self = shift;
my %args = @_;
my $new = $self->new();
foreach my $f ( @parameters ) {
$new->$f($self->$f()) if $self->$f();
}
# reset the old connection object like it's done at the end of a connection
# to prevent leaks (like prefork/tls problem with the old SSL file handle
# still around)
$self->reset unless $args{no_reset};
# should we generate a new id here?
return $new;
}
@ -196,9 +201,20 @@ set after a successful return from those hooks.
Connection-wide notes, used for passing data between plugins.
=head2 clone( )
=head2 clone([%args])
Returns a copy of the Qpsmtpd::Connection object.
Returns a copy of the Qpsmtpd::Connection object. The optional args parameter
may contain:
=over 4
=item no_reset (1|0)
If true, do not reset the original connection object, the author has to care
about that: only the cloned connection object is reset at the end of the
connection
=back
=cut