X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=perl%2FDXProt.pm;h=5f778207a76aca0e1e89ecd3bc05d2c4d6bd5a47;hb=26cab5eb43ff7295e88d2129d8d8d5c1fe37a10a;hp=1622728d4749760b59080caf41fc5d5698ed07fc;hpb=aff3103d753ce167d1a056eb982391bd4fcbb5cb;p=spider.git diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 1622728d..5f778207 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -317,7 +317,14 @@ sub send while (@_) { my $line = shift; if ($self->user->wantpc90) { - $line = mungepc90($line); + my ($pcno) = $line =~ /^PC(\d\d)/; + if ($pcno < 90) { + if ($pcno == 16 || $pcno == 17 || $pcno == 19 || $pcno == 21) { + $line = mungepc91($main::mycall, $line); + } else { + $line = mungepc90($line); + } + } } else { removepc91($line); removepc90($line); @@ -434,12 +441,6 @@ sub normal return; } } - } else { - if ($pcno == 16 || $pcno == 17 || $pcno == 19 || $pcno == 21) { - $line = mungepc91($origin, $line); - } else { - $line = mungepc90($line); - } } no strict 'subs'; @@ -1017,7 +1018,9 @@ sub handle_19 # if the origin isn't the same as the INTERFACE, then reparent, creating nodes as necessary if ($origin ne $self->call) { my $op = Route::Node::get($origin); - unless ($op) { + if ($op) { + $parent->add($op) unless $parent->haslink($op); + } else { $op = $parent->add($origin, 5000, Route::here(1)); my $user = DXUser->get_current($origin); if (!$user) { @@ -1160,10 +1163,13 @@ sub handle_21 my $parent = Route::Node::get($self->{call}); unless ($parent) { - dbg("DXPROT: my parent $self->{call} has disappeared"); + dbg("DXPROT: my parent $origin has disappeared"); $self->disconnect; return; } + my $or = Route::Node::get($origin) if $origin ne $self->{call}; + $parent = $or if $or; + if ($call ne $main::mycall) { # don't allow malicious buggers to disconnect me! my $node = Route::Node::get($call); if ($node) {