From: minima Date: Tue, 22 Feb 2005 13:50:20 +0000 (+0000) Subject: fix unknown user crash in Hello X-Git-Tag: R_1_52~172 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=a05049f350f2acb4de3f76c7aed205417da688f6;p=spider.git fix unknown user crash in Hello --- diff --git a/perl/DXUser.pm b/perl/DXUser.pm index 056fe9ff..cd30264e 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -297,6 +297,7 @@ sub put $lru->put($call, $self); my $ref = $self->encode; $dbm->put($call, $ref); + return $self; } # freeze the user diff --git a/perl/Thingy/Hello.pm b/perl/Thingy/Hello.pm index 4ff8ebda..52230aa1 100644 --- a/perl/Thingy/Hello.pm +++ b/perl/Thingy/Hello.pm @@ -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; diff --git a/perl/Thingy/Rt.pm b/perl/Thingy/Rt.pm index d06d5a38..0e6d21c0 100644 --- a/perl/Thingy/Rt.pm +++ b/perl/Thingy/Rt.pm @@ -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;