my $j = shift;
unless ($j) {
LogDbg('DXUser', "DXSubcommand::freeze: undefined or empty input");
- return q{[null, ""]};
+ return q{[null, '']};
}
eval { $r = encode_json($j) };
my $j = shift;
unless ($j) {
LogDbg('DXUser', "DXSubcommand::thaw: empty string on input");
- return q{[null, ""]};
+ return [undef,[0]];
}
return [undef, [1]] unless $j;
eval { $r = decode_json($j) };
if ($@) {
LogDbg('DXUser', "DXSubcommand::thaw: json error on '$j': $@");
- $r = qq{[$@,[1]]};
+ $r = [$@,[0]];
}
return $r;
}
$sock->on(read => sub {$conn->_rcv($_[1])});
$sock->timeout(0);
$sock->start;
- $conn->{peerhost} = $handle->peerhost;
+ $conn->{peerhost} = $handle->peerhost || 'unknown';
$conn->{peerhost} =~ s|^::ffff:||; # chop off leading pseudo IPV6 stuff on dual stack listeners
$conn->{peerport} = $handle->peerport || 0;
dbg((ref $conn) . " accept $conn->{cnum} from $conn->{peerhost}:$conn->{peerport}") if isdbg('conn') || isdbg('connect');