It appears that perl 5.10.1 has "issues" with Storable freeze/thaw
and, as we aren't doing anything clever with Mojo::IOLoop::Forkcall
in DXCommandmode, we will use JSON instead.
use VE7CC;
use DXXml;
use AsyncMsg;
+use JSON;
use Mojo::IOLoop;
use Mojo::IOLoop::ForkCall;
no strict 'refs';
my $fc = Mojo::IOLoop::ForkCall->new;
+ $fc->serializer(\&encode_json);
+ $fc->deserializer(\&decode_json);
$fc->run(
sub {my @args = @_; my @res = $cmdref->(@args); return @res},
$args,
# in child, unset warnings, disable debugging and general clean up from us
$^W = 0;
eval "{ package DB; sub DB {} }";
+ dbgclose();
+ Logclose();
DXChannel::closeall();
for (@main::listeners) {
$_->close_server;
sub dbgdump
{
+ return unless $fp;
+
my $l = shift;
my $m = shift;
- if ($fp && ($dbglevel{$l} || $l eq 'err')) {
+ if ($dbglevel{$l} || $l eq 'err') {
foreach my $l (@_) {
for (my $o = 0; $o < length $l; $o += 16) {
my $c = substr $l, $o, 16;
# The user is responsible for making sense of this!
sub Log
{
+ return unless $log;
+
my $t = time;
$log->writeunix($t, join('^', $t, @_) );
}
sub Logclose
{
$log->close();
+ undef $log;
}
1;