]> scm.dxcluster.org Git - spider.git/commitdiff
fix dx,ann cmds, add state to who cmd
authorDirk Koopman <djk@tobit.co.uk>
Fri, 31 Jan 2025 14:10:34 +0000 (14:10 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Fri, 31 Jan 2025 14:10:34 +0000 (14:10 +0000)
Also make the node initialisation test to determine whether it was
fit for normal traffic work correctly. This was stopping ann/full and
other things from working correctly.

Changes
cmd/dx.pl
cmd/who.pl
perl/DXProtHandle.pm

diff --git a/Changes b/Changes
index dad23d01d0583aaddfa0cd75e27a775ece05dd41..2ab22dfe09b15b7a13ca60a15b6748773849c3aa 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,8 @@
+31Jan25======================================================================
+1. Fixed botched node link initialisation check. This what prevent ann/full
+   working and would have stopped talk, rcmd etc etc. 
+2. Added a field called 'state' to the who command to allow sysops to
+   diagnose some connection initialisation problems. 
 29Jan25======================================================================
 1. Fix dx command <cough>. "I never changed that bit". If I had this would
    never have happened. 
index 958e7ad18e6d0a7e82d52e0cf45cf741f3f78d3e..00ceca4eae94f000c312589a58209903aac50baa 100644 (file)
--- a/cmd/dx.pl
+++ b/cmd/dx.pl
@@ -175,7 +175,6 @@ if ($freq =~ /^69/ || $localonly) {
        $ipaddr ||= $main::mycall;      # emergency backstop
        my $spot = DXProt::pc61($spotter, $freq, $spotted, unpad($line),  $ipaddr);
        
-#      $self->dx_spot(undef, undef, @spot);
        if ($self->isslugged) {
                push @{$self->{sluggedpcs}}, [61, $spot, \@spot];
        } else {
@@ -183,6 +182,7 @@ if ($freq =~ /^69/ || $localonly) {
                unless (Spot::dup_find(@spot)) {
                        Spot::dup_add(0, @spot);
                        Spot::add(@spot);
+                       $self->dx_spot(undef, undef, @spot);
                        DXProt::send_dx_spot($self, $spot, @spot);
                } else {
                        push @out, "Duplicate spot: $line";
index beb224a4c0c07c264cf50df44d06d0d8754f9ab8..dccd364f0e174ddfc93bd7eff00fa503298e02e6 100644 (file)
@@ -11,7 +11,7 @@ my $self = shift;
 my $dxchan;\r
 my @out;\r
 \r
-push @out, "  Callsign Type      Started           Name     Ave RTT Link";\r
+push @out, "  Callsign Type      State    Started           Name     Ave RTT Link";\r
 \r
 foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all ) {\r
     my $call = $dxchan->call();\r
@@ -39,7 +39,8 @@ foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all ) {
                $ip = $dxchan->hostname;\r
                $ip = "AGW Port ($conn->{agwport})" if exists $conn->{agwport};\r
        }\r
-       push @out, sprintf "%10s $type $sort $t %-10.10s $ping $ip", $call, $name;\r
+       my $state = $dxchan->state;\r
+       push @out, sprintf "%10s $type $sort %-8.8s $t %-10.10s $ping $ip", $call, $state, $name;\r
 }\r
 \r
 return (1, @out)\r
index ae6e7f863a23e2a06d11c4f740aeeb599e12d1f1..b33757fc5df9b1c82914e208a40eb64aa5915c9d 100644 (file)
@@ -75,6 +75,21 @@ $pc92filterdef = bless ([
                          ['zone', 'nz', 3],
                         ], 'Filter::Cmd');
 
+sub check_available
+{
+       my $self = shift;
+       my $origin = shift;
+       my $pcno = shift;
+       
+       return 0 if $self == $main::me;
+       
+       unless ($self->is_node && $self->state eq 'normal') {
+               dbg("PC$pcno sent to $self->{call} ignored as this channel is not yet initialised (state: $self-{state})");
+               return 1;
+       }
+       return 0;
+}
+
 our %pc11q;
 # this is a place to park an incoming PC11 in the sure and certain hope that
 # a PC61 will be along soon. This has the side benefit that it will delay a
@@ -94,12 +109,8 @@ sub handle_10
                return;
        }
 
-       unless ($self->state eq 'normal') {
-               dbg("PC$pcno sent from $self->{call} ignored as this channel is not yet initialised (state: $self-{state})");
-               return;
-       }
-
-
+       return if $self->check_available($origin, $pcno);
+                       
        # is it for me or one of mine?
        my ($from, $to, $via, $call, $dxchan);
        $from = $pc->[1];
@@ -167,11 +178,8 @@ sub handle_11
        my $pc = shift;
        my $recurse = shift || 0;
 
-       unless ($self->state eq 'normal') {
-               dbg("PC$pcno sent from $self->{call} ignored as this channel is not yet initialised (state: $self-{state})");
-               return;
-       }
-       
+       return if $self->check_available($origin, $pcno);
+
        # route 'foreign' pc26s
        if ($pcno == 26) {
                if ($pc->[7] ne $main::mycall) {
@@ -583,10 +591,7 @@ sub handle_12
        my $origin = shift;
        my $pc = shift;
 
-       unless ($self->state eq 'normal') {
-               dbg("PC$pcno sent from $self->{call} ignored as this channel is not yet initialised (state: $self-{state})");
-               return;
-       }
+       return if $self->check_available($origin, $pcno);
 
        # announce duplicate checking
        $pc->[3] =~ s/^\s+//;                   # remove leading blanks
@@ -1523,11 +1528,8 @@ sub handle_41
        my $origin = shift;
        my $pc = shift;
 
-       unless ($self->state eq 'normal') {
-               dbg("PC$pcno sent from $self->{call} ignored as this channel is not yet initialised (state: $self-{state})");
-               return;
-       }
-
+       return unless $self->check_available;
+       
        my $call = $pc->[1];
        my $sort = $pc->[2];
        my $val = $pc->[3];
@@ -1760,10 +1762,7 @@ sub handle_84
        my $origin = shift;
        my $pc = shift;
 
-       unless ($self->state eq 'normal') {
-               dbg("PC$pcno sent from $self->{call} ignored as this channel is not yet initialised (state: $self-{state})");
-               return;
-       }
+       return if $self->check_available($origin, $pcno);
 
        $self->process_rcmd($pc->[1], $pc->[2], $pc->[3], $pc->[4]);
 }
@@ -2476,11 +2475,8 @@ sub handle_93
        my $pc = shift;
 
        #       $self->{do_pc9x} ||= 1;
-       
-       unless ($self->state eq 'normal') {
-               dbg("PC$pcno sent from $self->{call} ignored as this channel is not yet initialised (state: $self-{state})");
-               return;
-       }
+
+       return if $self->check_available($origin, $pcno);
 
        my $pcall = $pc->[1];                   # this is now checked earlier