From cad4f2b1d6a8b1fb628c15019af3262d389696da Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Thu, 29 Jan 2015 00:15:43 -0800 Subject: [PATCH] TcpServer: don't 'use parent Qpsmtpd::Base' it breaks stuff. Instead, grab a base object and use it --- lib/Qpsmtpd/TcpServer.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/Qpsmtpd/TcpServer.pm b/lib/Qpsmtpd/TcpServer.pm index 4cff8ec..95b8a57 100644 --- a/lib/Qpsmtpd/TcpServer.pm +++ b/lib/Qpsmtpd/TcpServer.pm @@ -5,10 +5,12 @@ use POSIX (); use Socket; use lib 'lib'; +use Qpsmtpd::Base; use Qpsmtpd::Constants; -use parent 'Qpsmtpd::Base'; use parent 'Qpsmtpd::SMTP'; +my $base = Qpsmtpd::Base->new(); + my $has_ipv6 = 0; if ( eval { require Socket6; } && @@ -55,7 +57,7 @@ sub conn_info_inetd { my ($r_port, $iaddr) = sockaddr_in($hersockaddr); my $r_ip = inet_ntoa($iaddr); - my ($r_host) = $self->resolve_ptr($r_ip) || "[$r_ip]"; + my ($r_host) = $base->resolve_ptr($r_ip) || "[$r_ip]"; return ( local_ip => '', @@ -193,7 +195,9 @@ sub tcpenv { return $TCPLOCALIP, $TCPREMOTEIP, $TCPREMOTEIP ? "[$ENV{TCPREMOTEIP}]" : "[noip!]"; } - my ($TCPREMOTEHOST) = $self->resolve_ptr($TCPREMOTEIP) || 'Unknown'; + my ($TCPREMOTEHOST) = $base->resolve_ptr($TCPREMOTEIP); + $TCPREMOTEHOST ||= 'Unknown'; + return $TCPLOCALIP, $TCPREMOTEIP, $TCPREMOTEHOST; }