diff --git a/pandora_server/lib/PandoraFMS/DataServer.pm b/pandora_server/lib/PandoraFMS/DataServer.pm index b6bef2ade9..b7beb919a3 100644 --- a/pandora_server/lib/PandoraFMS/DataServer.pm +++ b/pandora_server/lib/PandoraFMS/DataServer.pm @@ -177,6 +177,7 @@ sub data_consumer ($$) { my $agent_name = $1; my $file_name = $pa_config->{'incomingdir'}; my $xml_err; + my $error; # Fix path $file_name .= "/" unless (substr ($file_name, -1, 1) eq '/'); @@ -208,10 +209,15 @@ sub data_consumer ($$) { }; # Invalid XML - if ($@ || ref($xml_data) ne 'HASH') { + if ($@) { + $error = 1; if ($XML::Simple::PREFERRED_PARSER eq 'XML::SAX::ExpatXS') { $XMLinSem->up(); } + } + + if ($error || ref($xml_data) ne 'HASH') { + if ($@) { $xml_err = $@; } else {