XML::SAX::ExpatXS thread protection

This commit is contained in:
fbsanchez 2019-08-07 13:45:57 +02:00
parent 4e42db2981
commit 32ad249024
1 changed files with 7 additions and 1 deletions

View File

@ -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 {