make PC29 output correct on empty lines
[spider.git] / perl / DXProt.pm
index 4f02d5193275b866d9577f3e31bc716d5420e1e8..f75d55c231e0c9b0e51ec79896d4c5de1ae48ff9 100644 (file)
@@ -239,7 +239,7 @@ sub start
 
        # send initialisation string
        unless ($self->{outbound}) {
-               $self->send(pc38()) if DXNode->get_all();
+#              $self->send(pc38()) if DXNode->get_all();
                $self->send(pc18());
                $self->{lastping} = $main::systime;
        } else {
@@ -263,6 +263,8 @@ sub normal
 {
        my ($self, $line) = @_;
        my @field = split /\^/, $line;
+       return unless @field;
+       
        pop @field if $field[-1] eq '~';
        
 #      print join(',', @field), "\n";
@@ -615,12 +617,16 @@ sub normal
                        if ($call ne $main::mycall) { # don't allow malicious buggers to disconnect me!
                                my $node = DXCluster->get_exact($call);
                                if ($node) {
+                                       if ($call eq $self->{call}) {
+                                               dbg('chan', "LOOP: Trying to disconnect myself with PC21");
+                                               return;
+                                       } 
                                        if ($node->dxchan != $self) {
                                                dbg('chan', "LOOP: $call come in on wrong channel");
                                                return;
                                        }
                                        my $dxchan;
-                                       if (($dxchan = DXChannel->get($call)) && $dxchan != $self) {
+                                       if ($dxchan = DXChannel->get($call)) {
                                                dbg('chan', "LOOP: $call connected locally");
                                                return;
                                        }
@@ -725,7 +731,7 @@ sub normal
                        if ($pcno == 49 || $field[1] eq $main::mycall) {
                                DXMsg::process($self, $line);
                        } else {
-                               $self->route($field[1], $line);
+                               $self->route($field[1], $line) unless $self->is_clx;
                        }
                        return;
                }
@@ -886,6 +892,13 @@ sub normal
                        return;
                }
 
+               if ($pcno == 75) {              # dunno but route it
+                       if ($field[1] ne $main::mycall) {
+                               $self->route($field[1], $line);
+                       }
+                       return;
+               }
+
                if ($pcno == 73) {  # WCY broadcasts
                        
                        # do some de-duping
@@ -1347,7 +1360,7 @@ sub broadcast_ak1a
 {
        my $s = shift;                          # the line to be rebroadcast
        my @except = @_;                        # to all channels EXCEPT these (dxchannel refs)
-       my @dxchan = DXChannel::get_all_ak1a();
+       my @dxchan = DXChannel::get_all_nodes();
        my $dxchan;
        
        # send it if it isn't the except list and isn't isolated and still has a hop count
@@ -1364,7 +1377,7 @@ sub broadcast_all_ak1a
 {
        my $s = shift;                          # the line to be rebroadcast
        my @except = @_;                        # to all channels EXCEPT these (dxchannel refs)
-       my @dxchan = DXChannel::get_all_ak1a();
+       my @dxchan = DXChannel::get_all_nodes();
        my $dxchan;
        
        # send it if it isn't the except list and isn't isolated and still has a hop count