]> dxcluster.org Git - spider.git/commitdiff
Merge PC34 unbless ref changes from main line
authorDirk Koopman <djk@tobit.co.uk>
Fri, 9 Mar 2012 22:20:03 +0000 (22:20 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Fri, 9 Mar 2012 22:20:03 +0000 (22:20 +0000)
Conflicts:
perl/DXUser.pm

1  2 
perl/DXUser.pm

diff --cc perl/DXUser.pm
index c273970bf542df3a8c0589124486239e537eee05,6cd6ca4f14bc6df4ba2bb4bd58d8e4f07ca108e9..84b6df3dd721ee99704c0a8867ece5c09dd8235a
@@@ -371,29 -246,21 +371,27 @@@ sub ge
        return $ref if $ref && ref $ref eq 'DXUser';
        
        # search for it
 -      unless ($dbm->get($call, $data)) {
 -              $ref = decode($data);
 -              if ($ref) {
 -                      if (UNIVERSAL::isa($ref, 'DXUser')) {
 -                              dbg("DXUser::get: got strange answer from decode of $call". ref $ref. " ignoring");
 -                              return undef;
 -                      }
 -                      # we have a reference and it *is* a DXUser
 -              } else {
 -                      dbg("DXUser::get: no reference returned from decode of $call $!");
 +      if ($v4) {
 +              if ($data = _select($call)) {
-                       $ref = bless decode_json($data), __PACKAGE__;
-                       $lru->put($call, $ref);
-                       return $ref;
++                      $ref = bless decode_json($data), 'DXUser';
 +              }
 +      } else {
 +          unless ($dbm->get($call, $data)) {
 +                      $ref = decode($data);
-                       if ($ref) {
-                               if (ref $ref ne 'DXUser') {
-                                       dbg("DXUser::get: got strange answer from decode ". ref $ref. " ignoring");
-                                       return undef;
-                               }
-                       } else {
-                               dbg("DXUser::get: no reference returned from decode $!");
-                               return undef;
-                       }
-                       $lru->put($call, $ref);
-                       return $ref;
 +              }
 +      }
 +      
++      if ($ref) {
++              if (UNIVERSAL::isa($ref, 'DXUser')) {
++                      dbg("DXUser::get: got strange answer from decode of $call". ref $ref. " ignoring");
+                       return undef;
+               }
 -              $lru->put($call, $ref);
 -              return $ref;
++              # we have a reference and it *is* a DXUser
++      } else {
++              dbg("DXUser::get: no reference returned from decode of $call $!");
++              return undef;
+       }
++      $lru->put($call, $ref);
        return undef;
  }