add more fixes for peerhosts
authorDirk Koopman <djk@tobit.co.uk>
Sat, 13 Mar 2010 19:41:54 +0000 (19:41 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Sat, 13 Mar 2010 19:41:54 +0000 (19:41 +0000)
Changes
perl/AGWMsg.pm
perl/BPQMsg.pm
perl/DXCommandmode.pm
perl/EphMsg.pm
perl/ExtMsg.pm
perl/Msg.pm
perl/UDPMsg.pm
perl/Version.pm

diff --git a/Changes b/Changes
index 261fb369a4e9ea3918b32dcc6d7a623b4123cfe0..e1a02d80a20923d76beee911eeca495fc76b764f 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,6 @@
 13Mar10=======================================================================
 1. try to fix AGW crashes caused by peerhost looking at the wrong thing.
+2. Add more ax25 fixes for peerhost
 03Mar10=======================================================================
 1. add IP addresses to connecting PC92 A addresses and log them
 2. add CTY-2002 prefixes
index 76b80fde344ef5601c97df9df3f5837e1d744575..910d32cc4c94c50c1f75b023f1666014fcfcb352 100644 (file)
@@ -412,7 +412,7 @@ sub _find
 sub peerhost
 {
        my $conn = shift;
-       $conn->{peerhost} ||= $conn->{agwcall} || "UNKNOWN";
+       $conn->{peerhost} ||= 'ax25';
        return $conn->{peerhost};
 }
 
index e5ca707789a0ef67ff5efc6fc05e706d73e5a43a..e95ae399900aa14ca6eee8320a8df02e96cdfef0 100644 (file)
@@ -134,6 +134,13 @@ sub active
        return $Buffers;
 }
 
+sub peerhost
+{
+       my $conn = shift;
+       $conn->{peerhost} ||= 'ax25';
+       return $conn->{peerhost};
+}
+
 
 sub connect
 {
index 87182fc69f08b44218f9f8fb2e9b29251469280d..798351773c998c62f603facd84c093c782873d34 100644 (file)
@@ -1224,7 +1224,7 @@ sub send_motd
        }
        $motd = "${main::motd}_$self->{lang}" unless $motd && -e $motd;
        $motd = $main::motd unless $motd && -e $motd;
-       if ($self->conn->{csort} eq 'ax25') {
+       if ($self->conn->ax25) {
                if ($motd) {
                        $motd = "${motd}_ax25" if -e "${motd}_ax25";
                } else {
index 0814df84d7288d5a21f0775d4b7f3c556e00d178..a6da8a2df2b54962f69dfa8e6e0c0a1726f52277 100644 (file)
@@ -45,7 +45,7 @@ sub dequeue
        my $conn = shift;
        my $msg;
 
-       if ($conn->{csort} eq 'ax25' && exists $conn->{msg}) {
+       if ($conn->ax25 && exists $conn->{msg}) {
                $conn->{msg} =~ s/\cM/\cJ/g;
        }
 
index 0ca2de83c6f5d367a67fbb4dc87d0267372b84f0..a84b598a49b0b7461e515e593c73ecc2112ce479 100644 (file)
@@ -72,7 +72,7 @@ sub dequeue
        my $conn = shift;
        my $msg;
 
-       if ($conn->{csort} eq 'ax25' && exists $conn->{msg}) {
+       if ($conn->ax25 && exists $conn->{msg}) {
                $conn->{msg} =~ s/\cM/\cJ/g;
        }
        if ($conn->{state} eq 'WC') {
@@ -153,7 +153,7 @@ sub to_connected
        delete $conn->{cmd};
        $conn->{timeout}->del if $conn->{timeout};
        delete $conn->{timeout};
-       $conn->nolinger unless $conn->isa('AGWMsg') || $conn->isa('BPQMsg');
+       $conn->nolinger unless $conn->ax25;
        &{$conn->{rproc}}($conn, "$dir$call|$sort");
        $conn->_send_file("$main::data/connected") unless $conn->{outgoing};
 }
index 531bff7336fb969f19cf581f9d7b5f41f24c4a7d..f2bb29768169b02b953887dcc6395a42d7b7175d 100644 (file)
@@ -193,14 +193,19 @@ sub pid_gone
        }
 }
 
+sub ax25
+{
+       my $conn = shift;
+       return $conn->{csort} eq 'ax25';
+}
+
 sub peerhost
 {
-       my $self = shift;
-       my $ip;
-       unless ($self->{peerhost}) {
-               $self->{peerhost} = $self->{sock}->peerhost;
-       }
-       return $self->{peerhost};
+       my $conn = shift;
+       $conn->{peerhost} ||= 'ax25' if $conn->ax25;
+       $conn->{peerhost} ||= $conn->{sock}->peerhost if $conn->{sock} && $conn->{sock}->isa('IO::Socket::INET');
+       $conn->{peerhost} ||= 'UNKNOWN';
+       return $conn->{peerhost};
 }
 
 #-----------------------------------------------------------------
index 566f021050380fa70e1028a0034c773505029805..b7241f9156dcd7896684031d6ab980971eab414b 100644 (file)
@@ -201,6 +201,13 @@ sub _find
        return $circuit{$call};
 }
 
+sub peerhost
+{
+       my $conn = shift;
+       $conn->{peerhost} ||= 'ax25';
+       return $conn->{peerhost};
+}
+
 sub connect
 {
        my ($conn, $line) = @_;
index 42f6c129cda5527da2f7cc812420fb77c47d7d2b..66456c43cf37edff66369a9aca09aac9915084d4 100644 (file)
@@ -11,6 +11,6 @@ use vars qw($version $subversion $build);
 
 $version = '1.55';
 $subversion = '0';
-$build = '63';
+$build = '64';
 
 1;