diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-10-29 18:46:48 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-10-29 18:46:48 +0400 |
commit | eac815c8914e12640430caf6e6b1b495c24404ad (patch) | |
tree | f73cade061f78e89b955cdd3732be2896a91de58 /perl | |
parent | 45352c2f76795884a956ec129d5d8a7bcbfd64bd (diff) | |
download | rspamd-eac815c8914e12640430caf6e6b1b495c24404ad.tar.gz rspamd-eac815c8914e12640430caf6e6b1b495c24404ad.zip |
Fix using of $1 and $2 in Mail::Rspamd::Client (reported by Andrej Zverev)
Diffstat (limited to 'perl')
-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, ); |