]> dxcluster.org Git - spider.git/commitdiff
fix unknown user crash in Hello
authorminima <minima>
Tue, 22 Feb 2005 13:50:20 +0000 (13:50 +0000)
committerminima <minima>
Tue, 22 Feb 2005 13:50:20 +0000 (13:50 +0000)
perl/DXUser.pm
perl/Thingy/Hello.pm
perl/Thingy/Rt.pm

index 056fe9ff50b3a1e2ce1c42cccc6f3491b4f19839..cd30264e1d16e54cfaea2d45e57680b2de51e277 100644 (file)
@@ -297,6 +297,7 @@ sub put
        $lru->put($call, $self);
        my $ref = $self->encode;
        $dbm->put($call, $ref);
+       return $self;
 }
 
 # freeze the user
index 4ff8ebda6f9b63fb254362ea7ce5b8fd01d9500b..52230aa16c2db0c727b00982685aca091a0a66d3 100644 (file)
@@ -113,7 +113,7 @@ sub handle
        if (my $user = $thing->{user}) {
                my $ur = Route::get($user);
                unless ($ur) {
-                       my $uref = DXUser->get_current($user);
+                       my $uref = DXUser->get_current($user) || Thingy::Hello::_upd_user_rec($user, $origin)->put;
                        if ($uref->is_node || $uref->is_aranea) {
                            $ur = $nref->add($user, $thing->{v}, $thing->{h});
                                push @{$thing->{pc19n}}, $ur if $ur;
index d06d5a380e0185e0f5f20b2b28a376aee80ec5ff..0e6d21c0393272f8602d9fcf1d6c4cb3275d9a3b 100644 (file)
@@ -162,7 +162,6 @@ sub _upd_user_rec
        my $parentcall = shift;
        
        # 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;
        $user->homenode($parentcall) if !$user->homenode;