projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix divide by zero error
[spider.git]
/
perl
/
DXXml.pm
diff --git
a/perl/DXXml.pm
b/perl/DXXml.pm
index a9072d467d4fcc3ea8e3ea150be2174c3cd749af..b990410127167ac19f8339126fb215be371888df 100644
(file)
--- a/
perl/DXXml.pm
+++ b/
perl/DXXml.pm
@@
-39,7
+39,7
@@
sub new
{
my $pkg = shift;
my $class = ref $pkg || $pkg;
{
my $pkg = shift;
my $class = ref $pkg || $pkg;
- my $self = bless{
@_
}, $class;
+ my $self = bless{}, $class;
while (@_) {
my $key = shift;
my $val = shift;
while (@_) {
my $key = shift;
my $val = shift;
@@
-64,7
+64,7
@@
sub init
$XML::Simple::PREFERRED_PARSER = 'XML::Parser';
import XML::Simple;
$DXProt::handle_xml = 1;
$XML::Simple::PREFERRED_PARSER = 'XML::Parser';
import XML::Simple;
$DXProt::handle_xml = 1;
- $xs = new XML::Simple(C
ache=>[]
);
+ $xs = new XML::Simple(C
ontentKey=>'content', ForceArray=>1
);
}
undef $@;
}
}
undef $@;
}
@@
-125,9
+125,9
@@
sub normal
$xref->{'-timet'} = $t;
return if DXDupe::check("xml,$o,$t,$id", $dupeage);
$xref->{'-timet'} = $t;
return if DXDupe::check("xml,$o,$t,$id", $dupeage);
-
$xref
= bless $xref, $pkg;
- $
xref
->{'-xml'} = $line;
- $
xref
->handle_input($dxchan);
+
my $r
= bless $xref, $pkg;
+ $
r
->{'-xml'} = $line;
+ $
r
->handle_input($dxchan);
}
#
}
#
@@
-156,7
+156,6
@@
sub process
DXXml::Ping::add($main::me, $dxchan->call);
$dxchan->{nopings} -= 1;
$dxchan->{lastping} = $t;
DXXml::Ping::add($main::me, $dxchan->call);
$dxchan->{nopings} -= 1;
$dxchan->{lastping} = $t;
- $dxchan->{lastping} += $dxchan->{pingint} / 2 unless @{$dxchan->{pingtime}};
}
}
}
}
}
}
@@
-269,24
+268,12
@@
sub route
if ($dxchan->handle_xml) {
$dxchan->send($self->toxml);
if ($dxchan->handle_xml) {
$dxchan->send($self->toxml);
- } elsif ($dxchan->isnode) {
+ } elsif ($dxchan->is
_
node) {
my $ref = $self->topcxx($dxchan);
my $ref = $self->topcxx($dxchan);
- if (ref $ref) {
- for (@$ref) {
- $dxchan->send($_);
- }
- } else {
- $dxchan->send($ref);
- }
+ $dxchan->send($ref);
} else {
my $ref = $self->tocmd($dxchan);
} else {
my $ref = $self->tocmd($dxchan);
- if (ref $ref) {
- for (@$ref) {
- $dxchan->send($_);
- }
- } else {
- $dxchan->send($ref);
- }
+ $dxchan->send($ref);
}
}
}
}