mega-merge of major parts of mojo
[spider.git] / perl / DXProt.pm
index 3c2311404065fbcbbf026e17dc5c86da4acbd5e2..b6c0b75903f61497b0343cad62899d09ab0d7eca 100644 (file)
@@ -246,8 +246,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 +289,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 +433,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);
        }
 }
 
@@ -956,6 +959,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 +978,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);