X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FMsg.pm;h=0e6ee9661c07abd36053f5a1ef1032db739f1d43;hb=5c4606e6c15b6518eadf808cb1a6c6cf67caf46b;hp=815937963962169d8fb2e4d8e0808cb8675bc2a4;hpb=3f64c5686df118fa3f3a1d66a87f25b89eb1732a;p=spider.git diff --git a/perl/Msg.pm b/perl/Msg.pm index 81593796..0e6ee966 100644 --- a/perl/Msg.pm +++ b/perl/Msg.pm @@ -118,7 +118,8 @@ sub conns if (ref $pkg) { $call = $pkg->{call} unless $call; return undef unless $call; - confess "changing $pkg->{call} to $call" if exists $pkg->{call} && $call ne $pkg->{call}; + dbg('connll', "changing $pkg->{call} to $call") if exists $pkg->{call} && $call ne $pkg->{call}; + delete $conns{$pkg->{call}} if $pkg->{call} ne $call; $pkg->{call} = $call; $ref = $conns{$call} = $pkg; dbg('connll', "Connection $pkg->{cnum} $call stored"); @@ -134,9 +135,9 @@ sub pid_gone my ($pkg, $pid) = @_; my @pid = grep {$_->{pid} == $pid} values %conns; - for (@pid) { - &{$_->{eproc}}($_, "$pid has gorn") if exists $_->{eproc}; - $_->disconnect; + foreach my $p (@pid) { + &{$p->{eproc}}($p, "$pid has gorn") if exists $p->{eproc}; + $p->disconnect; } } @@ -436,8 +437,8 @@ sub close_server # close all clients (this is for forking really) sub close_all_clients { - for (values %conns) { - $_->disconnect; + foreach my $conn (values %conns) { + $conn->disconnect; } }