X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FThingy%2FRt.pm;h=ab831de286a1dd43132812b2bec961e7d7b31f9a;hb=27b7373e5eb8d5501c2bd3d960934bc88c2daf82;hp=eb20fcabed17aba45fa23eb176fe8d46a97d2e87;hpb=dcbafa96df9fbad90df86076b6ee9fa6a673a61c;p=spider.git diff --git a/perl/Thingy/Rt.pm b/perl/Thingy/Rt.pm index eb20fcab..ab831de2 100644 --- a/perl/Thingy/Rt.pm +++ b/perl/Thingy/Rt.pm @@ -11,10 +11,8 @@ use strict; package Thingy::Rt; use vars qw($VERSION $BRANCH); -$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ ); -$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /^\d+\.\d+(?:\.(\d+)\.(\d+))?$/ || (0,0)); -$main::build += $VERSION; -$main::branch += $BRANCH; + +main::mkver($VERSION = q$Revision$); use DXChannel; use DXDebug; @@ -91,9 +89,9 @@ sub handle_eau my $dxchan = shift; if (my $d = $thing->{d}) { + my $nref; for (split /:/, $d) { my ($type, $here, $call) = unpack "A1 A1 A*", $_; - my $nref; if ($type eq 'U') { unless ($nref) { dbg("Thingy::Rt::ea need a node before $call"); @@ -114,10 +112,6 @@ sub handle_eau dbg("Thingy::Rt::ea invalid type $type"); return; } - unless ($nref) { - dbg("Thingy::Rt::ea no node"); - return; - } } } return $thing; @@ -129,15 +123,20 @@ sub handle_edu my $dxchan = shift; if (my $d = $thing->{d}) { + my $nref; for (split /:/, $d) { my ($type, $here, $call) = unpack "A1 A1 A*", $_; - my $nref; if ($type eq 'U') { unless ($nref) { - dbg("Thingy::Rt::ed need a node before $call"); + dbg("Thingy::Rt::edu need a node before $call"); return; } - $nref->del_user($call); + my $uref = Route::User::get($call); + unless ($uref) { + dbg("Thingy::Rt::edu $call not a user") if isdbg('chanerr'); + next; + } + $nref->del_user($uref); RouteDB::delete($call, $dxchan->{call}); } elsif ($type eq 'N') { $nref = Route::Node::get($call); @@ -150,10 +149,6 @@ sub handle_edu dbg("Thingy::Rt::ed invalid type $type"); return; } - unless ($nref) { - dbg("Thingy::Rt::ed no node"); - return; - } } } return $thing; @@ -219,5 +214,6 @@ sub upd_user_rec $user->homenode($parentcall) if !$user->homenode; $user->node($parentcall); $user->lastin($main::systime) unless DXChannel->get($call); + return $user; } 1;