X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXProt.pm;h=3c4b49f3d7d344fc1dc83825402d45beeed06cfd;hb=770092d94f96b6d22a38fb33e0056b4779a8a1ab;hp=3c2311404065fbcbbf026e17dc5c86da4acbd5e2;hpb=536ca8cd5840f5b1f8e7329ce5025fd904621594;p=spider.git diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 3c231140..3c4b49f3 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -33,6 +33,7 @@ use Route; use Route::Node; use Script; use DXProtHandle; +use DXCIDR; use strict; @@ -246,8 +247,9 @@ sub init $main::me->{pingave} = 0; $main::me->{registered} = 1; $main::me->{version} = $main::version; - $main::me->{build} = "$main::subversion.$main::build"; + $main::me->{build} = $main::build; $main::me->{do_pc9x} = 1; + $main::me->{hostname} = $main::clusteraddr; $main::me->update_pc92_next($pc92_short_update_period); $main::me->update_pc92_keepalive; } @@ -288,7 +290,9 @@ sub start # log it my $host = $self->{conn}->peerhost; $host ||= "AGW Port #$self->{conn}->{agwport}" if exists $self->{conn}->{agwport}; + $host ||= $host if is_ipaddr($host); $host ||= "unknown"; + $self->{hostname} = $host; Log('DXProt', "$call connected from $host"); @@ -430,9 +434,9 @@ sub normal my $sub = "handle_$pcno"; if ($self->can($sub)) { - $self->$sub($pcno, $line, $origin, @field); + $self->$sub($pcno, $line, $origin, \@field); } else { - $self->handle_default($pcno, $line, $origin, @field); + $self->handle_default($pcno, $line, $origin, \@field); } } @@ -553,6 +557,8 @@ sub send_dx_spot foreach $dxchan (@dxchan) { next if $dxchan == $main::me; next if $dxchan == $self && $self->is_node; + next if $dxchan == $self; + if ($line =~ /PC61/ && !($dxchan->is_spider || $dxchan->is_user)) { unless ($pc11) { my @f = split /\^/, $line; @@ -956,6 +962,7 @@ sub broadcast_pc92_update my $nref = Route::Node::get($call); unless ($nref) { cluck("ERROR: broadcast_pc92_update - Route::Node $call disappeared"); + $self->update_pc92_next; return; } my $l = $nref->last_PC92C(gen_my_pc92_config($nref)); @@ -974,6 +981,7 @@ sub broadcast_pc92_keepalive my $nref = Route::Node::get($call); unless ($nref) { cluck("ERROR: broadcast_pc92_keepalive - Route::Node $call disappeared"); + $self->update_pc92_keepalive; return; } my $l = pc92k($nref);