X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXChannel.pm;h=2758e64dd3a1f8c54fd65998fbee065ee2f6a51a;hb=654c9b77424b948f88816e0ef28bf4a27331afdb;hp=3637b7626885a6ec63e20720c8b3008ba03ba270;hpb=502f900651a46b96008028945616a3b610d6cc7a;p=spider.git diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index 3637b762..2758e64d 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -436,6 +436,26 @@ sub field_prompt 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-Z0-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 {