try to fix unblessed refs in PC34s
[spider.git] / perl / DXUser.pm
index 3bc4218ce289363e458be4f28fb6e1c14a472a56..419086adaa1230ef09e55772dc7fc17f625195f0 100644 (file)
@@ -89,6 +89,7 @@ $v3 = 0;
                  build => '1,Build',
                  believe => '1,Believable nodes,parray',
                  lastping => '1,Last Ping at,ptimelist',
+                 maxconnect => '1,Max Connections',
                 );
 
 #no strict;
@@ -248,10 +249,11 @@ sub get
        unless ($dbm->get($call, $data)) {
                $ref = decode($data);
                if ($ref) {
-                       if (ref $ref ne 'DXUser') {
+                       if (UNIVERSAL::isa($ref, 'DXUser')) {
                                dbg("DXUser::get: got strange answer from decode ". ref $ref. " ignoring");
                                return undef;
                        }
+                       # we have a reference and it *is* a DXUser
                } else {
                        dbg("DXUser::get: no reference returned from decode $!");
                        return undef;
@@ -277,7 +279,7 @@ sub get_current
        my $dxchan = DXChannel::get($call);
        if ($dxchan) {
                my $ref = $dxchan->user;
-               return $ref if ref $ref eq 'DXUser';
+               return $ref if $ref && UNIVERSAL::isa($ref, 'DXUser');
 
                dbg("DXUser::get_current: got invalid user ref from dxchan $dxchan->{call} ". ref $ref. " ignoring");
        }