From dcb4f4b5aa1d99180127681af8996fff1160922c Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Mon, 25 Jun 2007 19:32:29 +0100 Subject: [PATCH] fix longstanding possibility of a crash on new user. --- Changes | 1 + perl/DXProtHandle.pm | 16 ++++++++-------- perl/Version.pm | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Changes b/Changes index f0cb65b1..f2b9964a 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ 25Jun06======================================================================= 1. make sure that a C record is sent for node call every update period. 2. make announces work again (probably). +3. Fix long standing possibility of a crash with a new user. 24Jun06======================================================================= 1. Fix the routing algorithms to allow route selection in the face of incomplete trees of nodes (trees as produced by sh/newc). diff --git a/perl/DXProtHandle.pm b/perl/DXProtHandle.pm index b83da417..b4d80ab0 100644 --- a/perl/DXProtHandle.pm +++ b/perl/DXProtHandle.pm @@ -461,18 +461,17 @@ sub handle_16 push @rout, @ans if $h && @ans; } - # send info to all logged in thingies - $self->tell_login('loginu', "$ncall: $call") if DXUser->get_current($ncall)->is_local_node; - $self->tell_buddies('loginb', $call, $ncall); - # add this station to the user database, if required -# $call =~ s/-\d+$//o; # remove ssid for users - my $user = DXUser->get_current($call); - $user = DXUser->new($call) if !$user; + my $user = DXUser->get_current($ncall); + $user = DXUser->new($call) unless $user; $user->homenode($parent->call) if !$user->homenode; $user->node($parent->call); $user->lastin($main::systime) unless DXChannel::get($call); $user->put; + + # send info to all logged in thingies + $self->tell_login('loginu', "$ncall: $call") if $user->is_local_node; + $self->tell_buddies('loginb', $call, $ncall); } if (@rout) { $self->route_pc16($origin, $line, $parent, @rout) if @rout; @@ -540,7 +539,8 @@ sub handle_17 $parent->del_user($uref); # send info to all logged in thingies - $self->tell_login('logoutu', "$ncall: $ucall") if DXUser->get_current($ncall)->is_local_node; + my $user = DXUser->get_current($ncall); + $self->tell_login('logoutu', "$ncall: $ucall") if $user && $user->is_local_node; $self->tell_buddies('logoutb', $ucall, $ncall); if (eph_dup($line)) { diff --git a/perl/Version.pm b/perl/Version.pm index e13cfe28..6acfa98f 100644 --- a/perl/Version.pm +++ b/perl/Version.pm @@ -11,6 +11,6 @@ use vars qw($version $subversion $build); $version = '1.54'; $subversion = '0'; -$build = '90'; +$build = '91'; 1; -- 2.43.0