projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix weird sprintf error in AnnTalk dbging
[spider.git]
/
perl
/
DXProtHandle.pm
diff --git
a/perl/DXProtHandle.pm
b/perl/DXProtHandle.pm
index 4e55b9402c534a512a530362d26f380c9c2218b8..d1023270291a4be2209741b4d5197c9f63b4974f 100644
(file)
--- a/
perl/DXProtHandle.pm
+++ b/
perl/DXProtHandle.pm
@@
-158,17
+158,21
@@
sub handle_11
# if this is a 'nodx' node then ignore it
if ($badnode->in($pc->[7])) {
# if this is a 'nodx' node then ignore it
if ($badnode->in($pc->[7])) {
- dbg("PCPROT: Bad Node, dropped") if isdbg('chanerr');
+ dbg("PCPROT: Bad Node
$pc->[7]
, dropped") if isdbg('chanerr');
return;
}
return;
}
- # if this is a 'bad spotter'
user then ignore it
+ # if this is a 'bad spotter'
or an unknown user then ignore it. BUT if it's got an IP address then allow it through
my $nossid = $pc->[6];
$nossid =~ s/-\d+$//;
if ($badspotter->in($nossid)) {
my $nossid = $pc->[6];
$nossid =~ s/-\d+$//;
if ($badspotter->in($nossid)) {
- dbg("PCPROT: Bad Spotter, dropped") if isdbg('chanerr');
+ dbg("PCPROT: Bad Spotter
$pc->[6]
, dropped") if isdbg('chanerr');
return;
}
return;
}
+# unless (is_ipaddr($pc->[8]) || DXUser::get_current($pc->[6])) {
+# dbg("PCPROT: Unknown Spotter $pc->[6], dropped") if isdbg('chanerr');
+# return;
+# }
# convert the date to a unix date
my $d = cltounix($pc->[3], $pc->[4]);
# convert the date to a unix date
my $d = cltounix($pc->[3], $pc->[4]);
@@
-220,6
+224,14
@@
sub handle_11
# add it
Spot::add(@spot);
# add it
Spot::add(@spot);
+ if (isdbg('progress')) {
+ my $ip = '';
+ $ip = sprintf "($spot[14])" if $spot[14];
+ my $s = sprintf "SPOT: $spot[1] on $spot[0] \@ %s by $spot[4]$ip\@$spot[7]", cldatetime($spot[2]);
+ $s .= " '$spot[3]'" if $spot[3];
+ dbg($s);
+ }
+
#
# @spot at this point contains:-
# freq, spotted call, time, text, spotter, spotted cc, spotters cc, orig node
#
# @spot at this point contains:-
# freq, spotted call, time, text, spotter, spotted cc, spotters cc, orig node
@@
-653,8
+665,8
@@
sub check_add_node
$user->lockout(1);
$user->homenode($call);
$user->node($call);
$user->lockout(1);
$user->homenode($call);
$user->node($call);
+ $user->sort('A');
}
}
- $user->sort('A') unless $user->is_node;
return $user;
}
return $user;
}
@@
-709,7
+721,7
@@
sub handle_19
next unless $ver && $ver =~ /^\d+$/;
next if $ver < 5000; # only works with version 5 software
next if length $call < 3; # min 3 letter callsigns
next unless $ver && $ver =~ /^\d+$/;
next if $ver < 5000; # only works with version 5 software
next if length $call < 3; # min 3 letter callsigns
- next if $call eq $main::mycall;
+ next if $call eq $main::mycall
|| $call eq $main::myalias
;
# check that this PC19 isn't trying to alter the wrong dxchan
$h = 0;
# check that this PC19 isn't trying to alter the wrong dxchan
$h = 0;
@@
-853,7
+865,7
@@
sub handle_21
my @rout;
my @rout;
- if ($call ne $main::mycall) { # don't allow malicious buggers to disconnect me!
+ if ($call ne $main::mycall
&& $call ne $main::myalias
) { # don't allow malicious buggers to disconnect me!
my $node = Route::Node::get($call);
if ($node) {
my $node = Route::Node::get($call);
if ($node) {
@@
-864,7
+876,7
@@
sub handle_21
my $dxchan = DXChannel::get($call);
if ($dxchan && $dxchan != $self) {
my $dxchan = DXChannel::get($call);
if ($dxchan && $dxchan != $self) {
- dbg("PCPROT: PC21 from $self->{call} trying to alter locally connected $call, ignored!") if isdbg('chan
err
');
+ dbg("PCPROT: PC21 from $self->{call} trying to alter locally connected $call, ignored!") if isdbg('chan');
return;
}
return;
}
@@
-876,7
+888,7
@@
sub handle_21
push @rout, $call if $dxchan && @rout == 0;
}
} else {
push @rout, $call if $dxchan && @rout == 0;
}
} else {
- dbg("PCPROT: I WILL _NOT_ be disconnected!") if isdbg('chan
err
');
+ dbg("PCPROT: I WILL _NOT_ be disconnected!") if isdbg('chan');
return;
}
return;
}
@@
-1014,7
+1026,7
@@
sub handle_25
return;
}
if ($pc->[2] eq $main::mycall) {
return;
}
if ($pc->[2] eq $main::mycall) {
- dbg("PCPROT: Trying to merge to myself, ignored") if isdbg('chan
err
');
+ dbg("PCPROT: Trying to merge to myself, ignored") if isdbg('chan');
return;
}
return;
}
@@
-1169,7
+1181,7
@@
sub handle_41
return;
}
return;
}
- if ($call eq $main::mycall
&&
$call eq $main::myalias) {
+ if ($call eq $main::mycall
||
$call eq $main::myalias) {
dbg "DXPROT: PC41 trying to update $call from outside via $origin, ignored";
return;
}
dbg "DXPROT: PC41 trying to update $call from outside via $origin, ignored";
return;
}
@@
-1298,6
+1310,10
@@
sub handle_51
my $from = $pc->[2];
my $flag = $pc->[3];
my $from = $pc->[2];
my $flag = $pc->[3];
+ if ($to eq $main::myalias) {
+ dbg("DXPROT: Ping addressed to \$myalias ($main::myalias), ignored") if isdbg('chan');
+ return;
+ }
# is it for us?
if ($to eq $main::mycall) {
# is it for us?
if ($to eq $main::mycall) {
@@
-1646,7
+1662,11
@@
sub pc92_handle_first_slot
my ($call, $is_node, $is_extnode, $here, $version, $build) = @$slot;
if ($call && $is_node) {
if ($call eq $main::mycall) {
my ($call, $is_node, $is_extnode, $here, $version, $build) = @$slot;
if ($call && $is_node) {
if ($call eq $main::mycall) {
- dbg("PCPROT: $call looped back onto $main::mycall, ignored") if isdbg('chanerr');
+ dbg("PCPROT: $call looped back onto \$main::mycall ($main::mycall), ignored") if isdbg('chan');
+ return;
+ }
+ if ($call eq $main::myalias) {
+ dbg("PCPROT: $call looped back onto \$main::myalias ($main::myalias), ignored") if isdbg('chan');
return;
}
# this is only accepted from my "self".
return;
}
# this is only accepted from my "self".
@@
-1707,21
+1727,26
@@
sub handle_92
# }
if ($pcall eq $main::mycall) {
# }
if ($pcall eq $main::mycall) {
- dbg("PCPROT: looped back, ignored") if isdbg('chanerr');
+ dbg("PCPROT: looped back, ignored") if isdbg('chan');
+ return;
+ }
+
+ if ($pcall eq $main::myalias) {
+ dbg("PCPROT: looped back to \$myalias ($main::myalias), misconfiguration ignored") if isdbg('chan');
return;
}
if ($pcall eq $self->{call} && $self->{state} eq 'init') {
if ($self->{isolate}) {
return;
}
if ($pcall eq $self->{call} && $self->{state} eq 'init') {
if ($self->{isolate}) {
- dbg("PC9x received, but $pcall is isolated, ignored");
+ dbg("
DXPROT:
PC9x received, but $pcall is isolated, ignored");
return;
} elsif (!$self->user->wantpc9x) {
return;
} elsif (!$self->user->wantpc9x) {
- dbg("PC9x explicitly switched off on $pcall, ignored");
+ dbg("
DXPROT:
PC9x explicitly switched off on $pcall, ignored");
return;
} else {
$self->state('init92');
$self->{do_pc9x} = 1;
return;
} else {
$self->state('init92');
$self->{do_pc9x} = 1;
- dbg("Do pc9x set on $pcall");
+ dbg("D
XPROT: D
o pc9x set on $pcall");
}
}
unless ($self->{do_pc9x}) {
}
}
unless ($self->{do_pc9x}) {
@@
-1987,6
+2012,12
@@
sub handle_93
return;
}
return;
}
+ if (isdbg('progress')) {
+ my $vs = $via ne '*' ? " via $via" : '';
+ my $s = "ANNTALK: $from\@$onode$via -> $to '$text'";
+ dbg($s);
+ }
+
# will we allow it at all?
if ($censorpc) {
my @bad;
# will we allow it at all?
if ($censorpc) {
my @bad;