From: Dirk Koopman Date: Fri, 9 Mar 2012 22:20:03 +0000 (+0000) Subject: Merge PC34 unbless ref changes from main line X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=6951e5c6623c813b5f3da77796aa22c7e0848e44;p=spider.git Merge PC34 unbless ref changes from main line Conflicts: perl/DXUser.pm --- 6951e5c6623c813b5f3da77796aa22c7e0848e44 diff --cc perl/DXUser.pm index c273970b,6cd6ca4f..84b6df3d --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@@ -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; }