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:
parent
d7ef2ac660
commit
a05b334b44
@ -38,10 +38,15 @@ sub start {
|
|||||||
|
|
||||||
sub clone {
|
sub clone {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
my %args = @_;
|
||||||
my $new = $self->new();
|
my $new = $self->new();
|
||||||
foreach my $f ( @parameters ) {
|
foreach my $f ( @parameters ) {
|
||||||
$new->$f($self->$f()) if $self->$f();
|
$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?
|
# should we generate a new id here?
|
||||||
return $new;
|
return $new;
|
||||||
}
|
}
|
||||||
@ -196,9 +201,20 @@ set after a successful return from those hooks.
|
|||||||
|
|
||||||
Connection-wide notes, used for passing data between plugins.
|
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
|
=cut
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user