X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FExtMsg.pm;h=4efb3484c0621d58c90631ab247ff6c67d87304a;hb=c33a59698b9c2a7c319200620765d37706e12c5f;hp=07d77cba3a05b92ddb8b31bf82acd208a4421d1c;hpb=28830bd907c3f7192605ad4aa6c818feb2394e70;p=spider.git diff --git a/perl/ExtMsg.pm b/perl/ExtMsg.pm index 07d77cba..4efb3484 100644 --- a/perl/ExtMsg.pm +++ b/perl/ExtMsg.pm @@ -129,14 +129,14 @@ sub new_client { $conn->{sock} = $sock; Msg::blocking($sock, 0); $conn->{blocking} = 0; - my $host; - eval {$host = $conn->{peerhost}}; - my $port; - eval {$port = $conn->{peerport}} unless $@; + eval {$conn->{peerhost} = $sock->peerhost}; if ($@) { + dbg('conn', $@); $conn->disconnect; } else { - my ($rproc, $eproc) = &{$server_conn->{rproc}} ($conn, $conn->{peerhost} = $host, $conn->{peerport} = $port); + eval {$conn->{peerport} = $sock->peerport}; + $conn->{peerport} = 0 if $@; + my ($rproc, $eproc) = &{$server_conn->{rproc}} ($conn, $conn->{peerhost}, $conn->{peerport}); dbg('connll', "accept $conn->{cnum} from $conn->{peerhost} $conn->{peerport}"); if ($eproc) { $conn->{eproc} = $eproc;