3. added update_sysop.pl which cleans out all previous versions of the sysops
information from the user database and recreates it with that in DXVars.pm
4. Added node type to links and who
+5. Hardened up the cluster->client link in the cluster software so that
+rubbish on port 27754 doesn't (usually) crash the cluster.
14Jun00=======================================================================
1. fixed sh/node crash
2. fixed RTT in who.pl
return $valid{$ele};
}
+# take a standard input message and decode it into its standard parts
+sub decode_input
+{
+ my $dxchan = shift;
+ my $data = shift;
+ my ($sort, $call, $line) = $data =~ /^([A-Z])([A-Z1-9\-]{3,9})\|(.*)$/;
+
+ my $chcall = (ref $dxchan) ? $dxchan->call : "UN.KNOWN";
+
+ # the above regexp must work
+ if (!defined $sort || !defined $call || !defined $line ||
+ (ref $dxchan && $call ne $chcall)) {
+ $data =~ s/([\x00-\x1f\x7f-\xff])/uc sprintf("%%%02x",ord($1))/eg;
+ dbg('chan', "DUFF Line from $chcall: $data");
+ return ();
+ }
+
+ return ($sort, $call, $line);
+}
+
no strict;
sub AUTOLOAD
{
# set up the basic channel info - this needs a bit more thought - there is duplication here
if (!defined $dxchan) {
- my ($sort, $call, $line) = $msg =~ /^(\w)(\S+)\|(.*)$/;
+ my ($sort, $call, $line) = DXChannel::decode_input(0, $msg);
+ return unless defined $sort;
# is there one already connected to me - locally?
my $user = DXUser->get($call);
my $data = $self->{data};
my $dxchan = $self->{dxchan};
- my ($sort, $call, $line) = $data =~ /^(\w)([^\|]+)\|(.*)$/;
my $error;
-
- # the above regexp must work
- return unless ($sort && $call && $line);
+ my ($sort, $call, $line) = DXChannel::decode_input($dxchan, $data);
+ return unless defined $sort;
# translate any crappy characters into hex characters
if ($line =~ /[\x00-\x06\x08\x0a-\x1f\x7f-\xff]/o) {
$line =~ s/([\x00-\x1f\x7f-\xff])/uc sprintf("%%%02x",ord($1))/eg;
}
-
+
# do the really sexy console interface bit! (Who is going to do the TK interface then?)
dbg('chan', "<- $sort $call $line\n") unless $sort eq 'D';