From 8f391050421dd665bbf5fdcb3279a6074d97a74e Mon Sep 17 00:00:00 2001 From: minima Date: Mon, 28 Aug 2000 17:29:21 +0000 Subject: [PATCH] make PC29 output correct on empty lines escape ^ characters differently --- Changes | 4 ++++ perl/DXMsg.pm | 1 + perl/DXProt.pm | 8 ++++++-- perl/DXProtout.pm | 8 +++----- perl/Msg.pm | 2 +- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Changes b/Changes index 06d1a6e3..8e5d14b5 100644 --- 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 diff --git a/perl/DXMsg.pm b/perl/DXMsg.pm index 58c548a2..f9ede90c 100644 --- a/perl/DXMsg.pm +++ b/perl/DXMsg.pm @@ -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}) { diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 26d1b169..f75d55c2 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -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; } diff --git a/perl/DXProtout.pm b/perl/DXProtout.pm index 822beea5..8de0185b 100644 --- a/perl/DXProtout.pm +++ b/perl/DXProtout.pm @@ -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^~"; } diff --git a/perl/Msg.pm b/perl/Msg.pm index 0af67911..336ddf00 100644 --- a/perl/Msg.pm +++ b/perl/Msg.pm @@ -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; } -- 2.43.0