]> dxcluster.net Git - spider.git/commitdiff
add logging of PC92A ip addresses ip_address
authorDirk Koopman <djk@tobit.co.uk>
Thu, 26 Nov 2009 12:58:28 +0000 (12:58 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Thu, 26 Nov 2009 12:58:28 +0000 (12:58 +0000)
perl/DXProtHandle.pm
perl/Msg.pm
perl/Version.pm

index 90e7f47196d21f6aa06a22e7dc13be05a87ef777..c5d4bf4e756a77516b12080000f0bd14e7b37a63 100644 (file)
@@ -1404,15 +1404,25 @@ sub _add_thingy
        my @rout;
 
        if ($call) {
+               my $ncall = $parent->call;
                if ($is_node) {
-                       dbg("ROUTE: added node $call to " . $parent->call) if isdbg('routelow');
+                       dbg("ROUTE: added node $call to $ncall") if isdbg('routelow');
                        @rout = $parent->add($call, $version, Route::here($here), $ip);
                        my $r = Route::Node::get($call);
                        $r->PC92C_dxchan($dxchan->call, $hops) if $r;
+                       if ($ip) {
+                               $r->ip($ip);
+                               Log('DXProt', "PC92A $call -> $ip on $ncall");
+                       }
                } else {
-                       dbg("ROUTE: added user $call to " . $parent->call) if isdbg('routelow');
+                       dbg("ROUTE: added user $call to $ncall") if isdbg('routelow');
                        @rout = $parent->add_user($call, Route::here($here), $ip);
-                       $dxchan->tell_buddies('loginb', $call, $parent->call) if $dxchan;
+                       $dxchan->tell_buddies('loginb', $call, $ncall) if $dxchan;
+                       my $r = Route::User::get($call);
+                       if ($ip) {
+                               $r->ip($ip);
+                               Log('DXProt', "PC92A $call -> $ip on $ncall");
+                       }
                }
                if ($pc92_slug_changes && $parent == $main::routeroot) {
                        $things_add{$call} = Route::get($call);
index c9b58a482cb19398d9e94cc3cf471e3f69bb801d..531bff7336fb969f19cf581f9d7b5f41f24c4a7d 100644 (file)
@@ -196,6 +196,10 @@ sub pid_gone
 sub peerhost
 {
        my $self = shift;
+       my $ip;
+       unless ($self->{peerhost}) {
+               $self->{peerhost} = $self->{sock}->peerhost;
+       }
        return $self->{peerhost};
 }
 
index 8c8f5500fc5d2b0c3409f1eb4673154d68300ae2..605dca637c938a0b3c1cc6a5e9e87b22d36a30f9 100644 (file)
@@ -11,6 +11,6 @@ use vars qw($version $subversion $build);
 
 $version = '1.55';
 $subversion = '0';
-$build = '56';
+$build = '57';
 
 1;