+21Sep19=======================================================================
+1. Harden userfile decode / thaw to stop crashes from corrupt records
10Sep19=======================================================================
1. Improve DXSql database filtering to exclude most via <locator> type
reports.
# search for it
unless ($dbm->get($call, $data)) {
- $ref = decode($data);
+ $ref = eval{decode($data)};
if ($ref) {
if (!UNIVERSAL::isa($ref, 'DXUser')) {
dbg("DXUser::get: got strange answer from decode of $call". ref $ref. " ignoring");
}
# we have a reference and it *is* a DXUser
} else {
- dbg("DXUser::get: no reference returned from decode of $call $!");
+ dbg("DXUser::get: no reference returned from decode of $call $! $@");
return undef;
}
$lru->put($call, $ref);
my $r = $dbm->get($key, $value);
return undef if $r;
- return thaw($value);
+ my $v;
+ eval { $v = thaw($value) };
+ if ($@) {
+ LogDbg("Error thawing DXQSL key '$key' (now deleted): $@");
+ eval {$dbm->del($key)};
+ return undef;
+ }
+ return $v;
}
+
sub put
{
return unless $dbm;