X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FThingy%2FPing.pm;h=0d005e48eccf923d67ddd8b7f1f5922a76fea5e7;hb=8ef5f82f54963d7e0578a892e9336d254aff2e12;hp=902347dc30ec3a8f176bf9c30189d56407acc7b0;hpb=d0b280ab098497a7013807e869e4c641cbfcfc94;p=spider.git diff --git a/perl/Thingy/Ping.pm b/perl/Thingy/Ping.pm index 902347dc..0d005e48 100644 --- a/perl/Thingy/Ping.pm +++ b/perl/Thingy/Ping.pm @@ -55,14 +55,20 @@ sub gen_DXProt # {user} as well as a true user and also it may not # have originated here. - my $from = $thing->{o} if $thing->{out}; - $from ||= $thing->{user} if Route::Node::get($thing->{user}); - $from ||= $thing->{origin}; - my $to = $thing->{o} unless $thing->{out}; - $to ||= $thing->{touser} unless Route::User::get($thing->{touser}); - $to ||= $thing->{group}; - - + my ($from, $to); + if ($thing->{out}) { + $from = $thing->{o}; + $from ||= $thing->{user} unless Route::User::get($thing->{user}); + $from ||= $thing->{origin}; + $to = $thing->{touser} unless Route::User::get($thing->{touser}); + $to ||= $thing->{group}; + } else { + $from ||= $thing->{user} unless Route::User::get($thing->{user}); + $from ||= $thing->{origin}; + $to = $thing->{o}; + $to ||= $thing->{touser} unless Route::User::get($thing->{touser}); + $to ||= $thing->{group}; + } $thing->{DXProt} = DXProt::pc51($to, $from, $thing->{out}); } return $thing->{DXProt};