From 7f7535c09c58067e628590d92ae1953e9f6df83b Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Sun, 21 Jul 2013 23:38:24 +0100 Subject: [PATCH] Make peerhost data more consistent --- cmd/links.pl | 6 ++++-- perl/ExtMsg.pm | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/links.pl b/cmd/links.pl index a66ee194..8856ba27 100644 --- a/cmd/links.pl +++ b/cmd/links.pl @@ -25,8 +25,8 @@ foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all_nodes ) { my $sort; my $name = $dxchan->user->name || " "; my $obscount = $dxchan->nopings; - my $lastt = $dxchan->pingint - ($nowt - $dxchan->lastping); my $pingint = $dxchan->pingint; + my $lastt = $dxchan->lastping ? ($dxchan->pingint - ($nowt - $dxchan->lastping)) : $pingint; my $ping = $dxchan->is_node && $dxchan != $main::me ? sprintf("%8.2f",$dxchan->pingave) : ""; my $iso = $dxchan->isolate ? 'Y' :' '; my ($fin, $fout, $pc92) = (' ', ' ', ' '); @@ -45,6 +45,7 @@ foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all_nodes ) { $lastt = 0; $ping = " "; } + $sort = 'ANEA' if $dxchan->is_aranea; $sort = "DXSP" if $dxchan->is_spider; $sort = "CLX " if $dxchan->is_clx; @@ -57,7 +58,8 @@ foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all_nodes ) { my $addr = $dxchan->conn->peerhost; $ipaddr = $addr if is_ipaddr($addr); $ipaddr = 'local' if $addr =~ /^127\./ || $addr =~ /^::[0-9a-f]+$/; - } + } + $ipaddr = 'ax25' if $dxchan->conn->ax25; push @out, sprintf "%10s $sort $t$ping $obscount %5d %5d $iso $fin $fout $pc92 $ipaddr", $call, $pingint, $lastt; } diff --git a/perl/ExtMsg.pm b/perl/ExtMsg.pm index 6b2cce7d..f3f473ab 100644 --- a/perl/ExtMsg.pm +++ b/perl/ExtMsg.pm @@ -365,6 +365,7 @@ sub _doclient $conn->conns($call); $conn->{csort} = $f[1] if $f[1]; $conn->{state} = 'C'; + eval {$conn->{peerhost} = $conn->{sock}->peerhost} unless $conn->ax25; &{$conn->{rproc}}($conn, "O$call|$conn->{csort}"); delete $conn->{cmd}; $conn->{timeout}->del if $conn->{timeout}; -- 2.43.0