]> dxcluster.org Git - spider.git/commitdiff
make PC29 output correct on empty lines
authorminima <minima>
Mon, 28 Aug 2000 17:29:21 +0000 (17:29 +0000)
committerminima <minima>
Mon, 28 Aug 2000 17:29:21 +0000 (17:29 +0000)
escape ^ characters differently

Changes
perl/DXMsg.pm
perl/DXProt.pm
perl/DXProtout.pm
perl/Msg.pm

diff --git a/Changes b/Changes
index 06d1a6e3544ad394e4ea423dc7ccd0582922b95e..8e5d14b5468fbb2ca9e82e244c6d0432212efa35 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 28Aug00=======================================================================
 1. changes DXChannel::get_all_ak1a to get_all_nodes.
+2. ignore PC21s coming in on the interface with that callsign (ie nodes 
+trying to disconnect themselves).
+3. output correct PC29 on blank lines and escape ^ characters differently 
+(and transparently for spider nodes).
 26Aug00=======================================================================
 1. make blank origins on messages the node call.
 2. added new version of FAQ from Ian G0VGS
index 58c548a22ac19e000bdc417d3e9091b3c351ca89..f9ede90c4c167f9445019e243dc346d7bd565cfc 100644 (file)
@@ -212,6 +212,7 @@ sub process
                if ($pcno == 29) {              # incoming text
                        my $ref = $work{"$f[2]$f[3]"};
                        if ($ref) {
+                               $f[4] =~ s/\%5E/^/g;
                                push @{$ref->{lines}}, $f[4];
                                $ref->{count}++;
                                if ($ref->{count} >= $ref->{linesreq}) {
index 26d1b169854b585ee1cd94a136da525cb1ff47d7..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 {
@@ -617,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;
                                        }
index 822beea5fe7bb3ce5ba0c0beaf81f5c206705f40..8de0185b10b22fb45c84b3ea3a2d11246fe71dc9 100644 (file)
@@ -35,10 +35,8 @@ sub pc10
                $user2 = ' ';
                $user1 = $to;
        }
-#      my $user2 = $via ? $to : ' ';
-#      my $user1 = $via ? $via : $to;
        $text = unpad($text);
-       $text = ' ' if !$text;
+       $text = ' ' unless $text && length $text > 0;
        return "PC10^$from^$user1^$text^*^$user2^$main::mycall^~";  
 }
 
@@ -193,8 +191,8 @@ sub pc28
 sub pc29 
 {
        my ($fromnode, $tonode, $stream, $text) = @_;
-       $text =~ s/\^/:/og;                     # remove ^
-#      $text =~ s/\~/S/og;
+       $text = ' ' unless $text && length $text > 0;
+       $text =~ s/\^/%5E/og;                   # remove ^
        return "PC29^$fromnode^$tonode^$stream^$text^~";
 }
 
index 0af6791156f92b8c8e9698707fca33202ff3ae18..336ddf00e6e8f782904d7c1aa1f9740304191a25 100644 (file)
@@ -237,7 +237,7 @@ FINISH:
 
        while (@lines){
                $msg = shift @lines;
-               $msg =~ s/%([2-9A-F][0-9A-F])/chr(hex($1))/eg;
+               $msg =~ s/\%([2-9A-F][0-9A-F])/chr(hex($1))/eg;
                &{$conn->{rcvd_notification_proc}}($conn, $msg, $!);
                $! = 0;
        }