From 536ca8cd5840f5b1f8e7329ce5025fd904621594 Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Sun, 12 Jan 2014 16:43:37 +0000 Subject: [PATCH] fix dx and import_cmd problems --- Changes | 5 +++++ cmd/dx.pl | 4 +++- perl/DXCommandmode.pm | 2 +- perl/DXProt.pm | 4 ++-- perl/Version.pm | 4 ++-- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Changes b/Changes index 91ddd8ab..cbe6ff93 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,8 @@ +12Jan14======================================================================= +1. Fix minor issue with dx command when used in a script, as found by + Christian Furst. +2. Fix (rather serious) error in import_cmd that did not reset callsigns + correctly in $main::me. 30Dec13======================================================================= 1. Add CTY2312 prefix changes 19Nov13======================================================================= diff --git a/cmd/dx.pl b/cmd/dx.pl index d8dd56cb..18687a68 100644 --- a/cmd/dx.pl +++ b/cmd/dx.pl @@ -122,9 +122,11 @@ return (1, @out) unless $valid; my $ipaddr; -if ($self->conn->peerhost) { +if ($self->conn && $self->conn->peerhost) { my $addr = $self->conn->peerhost; $ipaddr = $addr unless !is_ipaddr($addr) || $addr =~ /^127\./ || $addr =~ /^::[0-9a-f]+$/; +} elsif ($self->inscript) { + $ipaddr = "script"; } # Store it here (but only if it isn't baddx) diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index ad9baad0..35c92341 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -1194,7 +1194,7 @@ sub import_cmd $dxchan->{priv} = $u->priv; $dxchan->{user} = $u; @out = $s->run($dxchan, 1); - $dxchan->{call} = $call; + $dxchan->{call} = $old; $dxchan->{priv} = $priv; $dxchan->{user} = $user; } else { diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 59deac9d..3c231140 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -955,7 +955,7 @@ sub broadcast_pc92_update my $nref = Route::Node::get($call); unless ($nref) { - dbg("ERROR: broadcast_pc92_update - Route::Node $call disappeared"); + cluck("ERROR: broadcast_pc92_update - Route::Node $call disappeared"); return; } my $l = $nref->last_PC92C(gen_my_pc92_config($nref)); @@ -973,7 +973,7 @@ sub broadcast_pc92_keepalive my $nref = Route::Node::get($call); unless ($nref) { - dbg("ERROR: broadcast_pc92_keepalive - Route::Node $call disappeared"); + cluck("ERROR: broadcast_pc92_keepalive - Route::Node $call disappeared"); return; } my $l = pc92k($nref); diff --git a/perl/Version.pm b/perl/Version.pm index d0b06da1..c531ab5f 100644 --- a/perl/Version.pm +++ b/perl/Version.pm @@ -11,7 +11,7 @@ use vars qw($version $subversion $build $gitversion); $version = '1.55'; $subversion = '0'; -$build = '138'; -$gitversion = '9e086e9'; +$build = '140'; +$gitversion = '94c061b'; 1; -- 2.34.1