From: Dirk Koopman Date: Sun, 26 Dec 2021 18:38:33 +0000 (+0000) Subject: set def sendverity=0, some hostname changes X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=d0b55caa8a609da9ccc5ea59bb376795a99d04b5;p=spider.git set def sendverity=0, some hostname changes Make sure that an IP address (even 127.0.0.1) is always found. Don't send PC41 if home isn't changed set senderverify default = 0. --- diff --git a/cmd/announce.pl b/cmd/announce.pl index 962aebb6..9065993b 100644 --- a/cmd/announce.pl +++ b/cmd/announce.pl @@ -17,6 +17,8 @@ my ($self, $line) = @_; #$DB::single = 1; +my $addr = $self->hostname || '127.0.0.1'; +Log('cmd', "$self->{call}|$addr|announce|$line"); my @f = split /\s+/, $line; return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript; return (1, $self->msg('e9')) if !@f; diff --git a/cmd/dx.pl b/cmd/dx.pl index f1f72d4d..4a80df0e 100644 --- a/cmd/dx.pl +++ b/cmd/dx.pl @@ -23,6 +23,10 @@ my $oline = $line; return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript; return (1, $self->msg('e28')) unless $self->isregistered; + +my $addr = $self->hostname || '127.0.0.1' +Log('cmd', "$self->{call}|$addr|dx|$line"); + my @bad; if (@bad = BadWords::check($line)) { $self->badcount(($self->badcount||0) + @bad); @@ -73,9 +77,7 @@ $line =~ s/^\s*$f[0]\s+$f[1]\s+//; $line =~ s/\t+/ /g; # do this here because it needs to be stopped ASAP! $line ||= ' '; -my $addr = $self->hostname; if ($self->conn && $self->conn->peerhost) { -# $ipaddr = $addr unless !is_ipaddr($addr) || $addr =~ /^127\./ || $addr =~ /^::[0-9a-f]+$/; $ipaddr ||= $addr; # force a PC61 } elsif ($self->inscript) { $ipaddr = "script"; diff --git a/cmd/set/homenode.pl b/cmd/set/homenode.pl index 605c0c21..f2f8e6e7 100644 --- a/cmd/set/homenode.pl +++ b/cmd/set/homenode.pl @@ -19,12 +19,14 @@ return (1, $self->msg('hnodee1')) if !$line; $user = DXUser::get_current($call); if ($user) { - $line = uc $line; - $user->homenode($line); - $user->put(); - my $s = DXProt::pc41($call, 4, $line); - DXProt::eph_dup($s); - DXChannel::broadcast_all_nodes($s, $main::me) ; + $line = uc unpad($line); + if ($user->homenode && $line ne $user->homenode) { + $user->homenode($line); + $user->put(); + my $s = DXProt::pc41($call, 4, $line); + DXProt::eph_dup($s); + DXChannel::broadcast_all_nodes($s, $main::me); + } return (1, $self->msg('hnode', $line)); } else { return (1, $self->msg('namee2', $call)); diff --git a/cmd/show/contest.pl b/cmd/show/contest.pl index a9db4ea7..451a55da 100644 --- a/cmd/show/contest.pl +++ b/cmd/show/contest.pl @@ -9,7 +9,7 @@ sub handle { my ($self, $line) = @_; - + return (1, $self->msg('e24')) unless $Internet::allow; my @out; diff --git a/cmd/show/qrz.pl b/cmd/show/qrz.pl index 5863767e..1bcd8347 100644 --- a/cmd/show/qrz.pl +++ b/cmd/show/qrz.pl @@ -73,8 +73,8 @@ sub handle my $port = 80; my $path = qq{/xml/current/?callsign=$line;username=$Internet::qrz_uid;password=$Internet::qrz_pw;agent=dxspider}; dbg("qrz: $target:$port$path") if isdbg('qrz'); - - Log('call', "$call: show/qrz \U$line"); + my $addr = $self->hostname || '127.0.0.1'; + Log('cmd', "$self->{call}|$addr|show/qrz|$line"); my $conn = AsyncMsg->get($self, $target, $path, filter=>\&filter, prefix=>'qrz> ', on_disc=>\&_on_disc); if ($conn) { $conn->{state} = 'blank'; diff --git a/cmd/spoof.pl b/cmd/spoof.pl index e0194a11..c6d93e78 100644 --- a/cmd/spoof.pl +++ b/cmd/spoof.pl @@ -35,7 +35,8 @@ unless ($user) { # set up basic environment $self->call($call); $self->user($user); -Log('DXCommand', "spoof '$newline' as $call by $mycall"); +my $addr = $self->hostname || '127.0.0.1' +Log('cmd', "$self->{call}|$addr|spoof|$line"); my @in = $self->run_cmd($newline); push @out, map {"spoof $call: $_"} @in; $self->call($mycall); diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 00c82125..a2d59a58 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -552,6 +552,7 @@ sub run_cmd if ($package && $self->can("${package}::handle")) { no strict 'refs'; dbg("cmd: package $package") if isdbg('command'); +# Log('cmd', "$self->{call} on $self->{hostname} : '$cmd $args'"); my $t0 = [gettimeofday]; eval { @ans = &{"${package}::handle"}($self, $args) }; if ($@) { diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 95940e58..fe7af2dd 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -82,7 +82,7 @@ $pc92_extnode_update_period = 1*60*60; # the update period for external nodes $pc92_keepalive_period = 1*60*60; # frequency of PC92 K (keepalive) records %pc92_find = (); # outstanding pc92 find operations $pc92_find_timeout = 30; # maximum time to wait for a reply -$senderverify = 1; # 1 = check spotter is on node it says it is and check ip address if available +$senderverify = 0; # 1 = check spotter is on node it says it is and check ip address if available # 2 = do 1 and dump if check