From: djk Date: Wed, 18 Aug 1999 07:53:37 +0000 (+0000) Subject: made all protocol except PC29 reject %xx characters X-Git-Tag: R_1_31~5 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=e0278322b79d09a997ed7df948c57b58f02b139c;p=spider.git made all protocol except PC29 reject %xx characters mode console reset its top screen when you start to type in stuff --- diff --git a/Changes b/Changes index 18e9f143..7c93f082 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,7 @@ +17Aug99======================================================================= +1. all protocol except PC29 containing %XX characters will be dumped. +2. Changed console.pl so that if you start typing it moves the top window +back to the bottom. 19Jul99======================================================================= 1. Added iota and qra clauses to sh/dx as well, these take optional arguments and will look for the appropriate strings. diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 30b1b278..7d429b1b 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -149,7 +149,13 @@ sub normal my ($pcno) = $field[0] =~ /^PC(\d\d)/; # just get the number return unless $pcno; return if $pcno < 10 || $pcno > 51; - + + # dump bad protocol messages unless it is a PC29 + if ($line =~ /\%[0-9A-F][0-9A-F]/o && $pcno != 29) { + dbg('chan', "CORRUPT protocol message - dumped"); + return; + } + # local processing 1 my $pcr; eval { diff --git a/perl/client.pl b/perl/client.pl index 1914ab31..2e6a4f17 100755 --- a/perl/client.pl +++ b/perl/client.pl @@ -261,6 +261,7 @@ sub dochat for (;;) { if ($csort eq 'telnet') { $line = $sock->get(); + cease(11) unless $line; # the socket has gone away? $line =~ s/\r\n/\n/og; chomp; } elsif ($csort eq 'ax25' || $csort eq 'prog') { diff --git a/perl/console.pl b/perl/console.pl index 41eb8016..50196907 100755 --- a/perl/console.pl +++ b/perl/console.pl @@ -159,6 +159,7 @@ sub rec_stdin # $prbuf =~ s/\n/\\n/; # print "sys: $r ($prbuf)\n"; if (defined $r) { + if ($r eq KEY_ENTER || $r eq "\n" || $r eq "\r") { # save the lines @@ -266,6 +267,13 @@ sub rec_stdin beep(); } } elsif ($r ge ' ' && $r le '~') { + # move the top screen back to the bottom if you type something + if ($spos < @shistory - 1) { + $spos = @shistory; + show_screen(); + } + + # insert the character into the keyboard buffer if ($pos < $lth) { my $a = substr($inbuf, 0, $pos); my $b = substr($inbuf, $pos);