projects
/
spider.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
28830bd
)
re-arrange ExtMsg a bit to cope with $sock->peerhost and port failures
author
minima
<minima>
Sun, 3 Jun 2001 12:49:43 +0000
(12:49 +0000)
committer
minima
<minima>
Sun, 3 Jun 2001 12:49:43 +0000
(12:49 +0000)
perl/ExtMsg.pm
patch
|
blob
|
history
diff --git
a/perl/ExtMsg.pm
b/perl/ExtMsg.pm
index 07d77cba3a05b92ddb8b31bf82acd208a4421d1c..4efb3484c0621d58c90631ab247ff6c67d87304a 100644
(file)
--- 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;
$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 ($@) {
if ($@) {
+ dbg('conn', $@);
$conn->disconnect;
} else {
$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;
dbg('connll', "accept $conn->{cnum} from $conn->{peerhost} $conn->{peerport}");
if ($eproc) {
$conn->{eproc} = $eproc;