diff options
-rw-r--r-- | perl/lib/Mail/Rspamd/Client.pm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/perl/lib/Mail/Rspamd/Client.pm b/perl/lib/Mail/Rspamd/Client.pm index 6cc316b2f..d98afc8b4 100644 --- a/perl/lib/Mail/Rspamd/Client.pm +++ b/perl/lib/Mail/Rspamd/Client.pm @@ -616,11 +616,12 @@ sub _create_connection { } } elsif ($hostdef =~ /^\s*(([^:]+):(\d+))\s*$/) { + my $peer_addr = $2; if ($2 eq '*') { - $2 = '127.0.0.1'; + $peer_addr = '127.0.0.1'; } $remote = IO::Socket::INET->new( Proto => "tcp", - PeerAddr => $2, + PeerAddr => $peer_addr, PeerPort => $3, Blocking => 0, ); @@ -636,11 +637,12 @@ sub _create_connection { } } elsif ($hostdef =~ /^\s*([^:]+)\s*$/) { + my $peer_addr = $1; if ($1 eq '*') { - $1 = '127.0.0.1'; + $peer_addr = '127.0.0.1'; } $remote = IO::Socket::INET->new( Proto => "tcp", - PeerAddr => $1, + PeerAddr => $peer_addr, PeerPort => $self->{control} ? 11334 : 11333, Blocking => 0, ); |