Close the SSL socket created by duplicating the connection file descriptor. This allows the server to close the connection file descriptor without getting errors like:
Can't call method "close" on an undefined value at /usr/share/perl5/IO/Socket/SSL.pm line 780. git-svn-id: https://svn.perl.org/qpsmtpd/trunk@937 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
6ad7e24315
commit
0d96de470d
2
Changes
2
Changes
@ -1,3 +1,5 @@
|
|||||||
|
plugins/tls: close the file descriptor for the SSL socket
|
||||||
|
|
||||||
Set the Return-Path header when queuing into maildir mailboxes.
|
Set the Return-Path header when queuing into maildir mailboxes.
|
||||||
|
|
||||||
prefork, forkserver: restart on SIGHUP (reload all modules, with register() /
|
prefork, forkserver: restart on SIGHUP (reload all modules, with register() /
|
||||||
|
14
plugins/tls
14
plugins/tls
@ -152,6 +152,19 @@ sub hook_connect {
|
|||||||
return DECLINED;
|
return DECLINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub hook_post_connection {
|
||||||
|
my ($self, $transaction) = @_;
|
||||||
|
|
||||||
|
my $tls_socket = $self->connection->notes('tls_socket');
|
||||||
|
if (defined $tls_socket && $self->connection->notes('tls_socket_is_duped')) {
|
||||||
|
$tls_socket->close;
|
||||||
|
$self->connection->notes('tls_socket', undef);
|
||||||
|
$self->connection->notes('tls_socked_is_duped', 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return DECLINED;
|
||||||
|
}
|
||||||
|
|
||||||
sub _convert_to_ssl {
|
sub _convert_to_ssl {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
|
|
||||||
@ -175,6 +188,7 @@ sub _convert_to_ssl {
|
|||||||
$self->qp->connection($self->connection->clone());
|
$self->qp->connection($self->connection->clone());
|
||||||
$self->qp->reset_transaction;
|
$self->qp->reset_transaction;
|
||||||
*STDIN = *STDOUT = $self->connection->notes('tls_socket', $tlssocket);
|
*STDIN = *STDOUT = $self->connection->notes('tls_socket', $tlssocket);
|
||||||
|
$self->connection->notes('tls_socket_is_duped', 1);
|
||||||
$self->connection->notes('tls_enabled', 1);
|
$self->connection->notes('tls_enabled', 1);
|
||||||
};
|
};
|
||||||
if ($@) {
|
if ($@) {
|
||||||
|
Loading…
Reference in New Issue
Block a user