fix longstanding possibility of a crash on new user.
authorDirk Koopman <djk@tobit.co.uk>
Mon, 25 Jun 2007 18:32:29 +0000 (19:32 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Mon, 25 Jun 2007 18:32:29 +0000 (19:32 +0100)
Changes
perl/DXProtHandle.pm
perl/Version.pm

diff --git a/Changes b/Changes
index f0cb65b12d8e4f7aeb738afb56dcae9cd7ad1d13..f2b9964aaf663ed0f0410022230dc4494a210c4f 100644 (file)
--- 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).
index b83da41784b10ebb4f4d76bd13c25b34d30dfc3b..b4d80ab09957fccdea84ccceeaa7d5ef077a587e 100644 (file)
@@ -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)) {
index e13cfe2826d5c5b40956ce6a1127918d2d844b63..6acfa98fb5c387de496a190b64c664b3751e6108 100644 (file)
@@ -11,6 +11,6 @@ use vars qw($version $subversion $build);
 
 $version = '1.54';
 $subversion = '0';
-$build = '90';
+$build = '91';
 
 1;