X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXProtHandle.pm;h=3e4d3134d40ba532bec9138fab4503679ffe2f30;hb=d7a3d8da34eeb5ddb1457e90ea16c0ac9d93967a;hp=7839e11c55ea868a81a159aa395b28188c50d98c;hpb=eef5dcbb47966521543e82dbb0b9269ec245d3d8;p=spider.git diff --git a/perl/DXProtHandle.pm b/perl/DXProtHandle.pm index 7839e11c..3e4d3134 100644 --- a/perl/DXProtHandle.pm +++ b/perl/DXProtHandle.pm @@ -43,11 +43,12 @@ use vars qw($pc11_max_age $pc23_max_age $last_pc50 $eph_restime $eph_info_restim $investigation_int $pc19_version $myprot_version %nodehops $baddx $badspotter $badnode $censorpc $allowzero $decode_dk0wcy $send_opernam @checklist - $eph_pc15_restime $pc9x_past_age + $eph_pc15_restime $pc9x_past_age $pc9x_dupe_age $pc10_dupe_age $pc92_slug_changes $last_pc92_slug $pc92Ain $pc92Cin $pc92Din $pc92Kin $pc9x_time_tolerance ); +$pc9x_dupe_age = 60; # catch loops of circular (usually) D records $pc10_dupe_age = 45; # just something to catch duplicate PC10->PC93 conversions $pc92_slug_changes = 60; # slug any changes going outward for this long $last_pc92_slug = 0; # the last time we sent out any delayed add or del PC92s @@ -272,12 +273,13 @@ sub handle_11 } # local processing - my $r; - eval { - $r = Local::spot($self, @spot); - }; - # dbg("Local::spot1 error $@") if isdbg('local') if $@; - return if $r; + if (defined *Local::spot) { + my $r; + eval { + $r = Local::spot($self, @spot); + }; + return if $r; + } # DON'T be silly and send on PC26s! return if $pcno == 26; @@ -356,6 +358,15 @@ sub handle_12 } else { $self->route($_[2], $line); } + + # local processing + if (defined *Local::ann) { + my $r; + eval { + $r = Local::ann($self, $line, @_[1..6]); + }; + return if $r; + } } sub handle_15 @@ -936,12 +947,13 @@ sub handle_23 # note this only takes the first one it gets Geomag::update($d, $_[2], $sfi, $k, $i, @_[6..8], $r); - my $rep; - eval { - $rep = Local::wwv($self, $_[1], $_[2], $sfi, $k, $i, @_[6..8], $r); - }; - # dbg("Local::wwv2 error $@") if isdbg('local') if $@; - return if $rep; + if (defined *Local::wwv) { + my $rep; + eval { + $rep = Local::wwv($self, $_[1], $_[2], $sfi, $k, $i, @_[6..8], $r); + }; + return if $rep; + } # DON'T be silly and send on PC27s! return if $pcno == 27; @@ -1306,12 +1318,13 @@ sub handle_73 my $wcy = WCY::update($d, @_[2..12]); - my $rep; - eval { - $rep = Local::wcy($self, @_[1..12]); - }; - # dbg("Local::wcy error $@") if isdbg('local') if $@; - return if $rep; + if (defined *Local::wcy) { + my $rep; + eval { + $rep = Local::wcy($self, @_[1..12]); + }; + return if $rep; + } # broadcast to the eager world send_wcy_spot($self, $line, $d, @_[2..12]); @@ -1516,7 +1529,7 @@ sub check_pc9x_t # and old dupes with $t = 234, $lastid = 256 (which give answers 249 and # 86378 respectively in the calculation below). # - if (($t-$lastid)%86400 > $pc9x_past_age) { + if ($t+86400-$lastid > $pc9x_past_age) { dbg("PCPROT: dup id on $t <= lastid $lastid, ignored") if isdbg('chanerr') || isdbg('pc92dedupe'); return undef; } @@ -1529,6 +1542,7 @@ sub check_pc9x_t } elsif ($create) { $parent = Route::Node->new($call); } else { + dbg("PCPROT: $call does not exist, ignored") if isdbg('pc92dedupe'); return undef; } if (isdbg('pc92dedupe')) { @@ -1608,6 +1622,11 @@ sub handle_92 my $t = $_[2]; my $sort = $_[3]; + # this catches loops of A/Ds +# if (eph_dup($line, $pc9x_dupe_age)) { +# return; +# } + if ($pcall eq $main::mycall) { dbg("PCPROT: looped back, ignored") if isdbg('chanerr'); return; @@ -1631,7 +1650,9 @@ sub handle_92 return; } - my $parent = check_pc9x_t($pcall, $t, 92, 1) || return; + # don't create routing entries for D records that don't already exist + # this is what causes all those PC92 loops! + my $parent = check_pc9x_t($pcall, $t, 92, $sort ne 'D') || return; my $oparent = $parent; $parent->do_pc9x(1);