From c33a59698b9c2a7c319200620765d37706e12c5f Mon Sep 17 00:00:00 2001 From: minima Date: Sun, 3 Jun 2001 12:49:43 +0000 Subject: [PATCH] re-arrange ExtMsg a bit to cope with $sock->peerhost and port failures --- perl/ExtMsg.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; -- 2.34.1