2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-20 07:16:03 +00:00

98_HTTPMOD.pm: remove precompilation of preProcesRegex

git-svn-id: https://svn.fhem.de/fhem/trunk@20551 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
StefanStrobel 2019-11-20 17:05:14 +00:00
parent 77ff9184b8
commit c996a2a75c

View File

@ -169,6 +169,7 @@
# 2019-11-11 modified precompilation of regexes to better support regex options # 2019-11-11 modified precompilation of regexes to better support regex options
# 2019-11-17 remove unused function, reformat # 2019-11-17 remove unused function, reformat
# 2019-11-19 little bug fixes # 2019-11-19 little bug fixes
# 2019-11-20 precompilation of preProcessRegex removed - needs more testing before a release
# #
# #
@ -240,7 +241,7 @@ sub HTTPMOD_AddToQueue($$$$$;$$$$$);
sub HTTPMOD_JsonFlatter($$;$); sub HTTPMOD_JsonFlatter($$;$);
sub HTTPMOD_ExtractReading($$$$$); sub HTTPMOD_ExtractReading($$$$$);
my $HTTPMOD_Version = '3.5.17 - 19.11.2019'; my $HTTPMOD_Version = '3.5.18 - 20.11.2019';
# #
# FHEM module intitialisation # FHEM module intitialisation
@ -1854,6 +1855,7 @@ sub HTTPMOD_GetRegex($$$$$)
my $regDecode = AttrVal($name, 'regexDecode', ""); my $regDecode = AttrVal($name, 'regexDecode', "");
my $regCompile = AttrVal($name, 'regexCompile', 1); my $regCompile = AttrVal($name, 'regexCompile', 1);
#Log3 $name, 5, "$name: Look for Regex $context$num$type";
# first look for attribute with the full num in it # first look for attribute with the full num in it
if ($num && defined ($attr{$name}{$context . $num . $type})) { # specific regex attr exists if ($num && defined ($attr{$name}{$context . $num . $type})) { # specific regex attr exists
return $attr{$name}{$context . $num . $type} if (!$regCompile); return $attr{$name}{$context . $num . $type} if (!$regCompile);
@ -2771,9 +2773,8 @@ sub HTTPMOD_Read($$$)
Log3 $name, 4, "$name: Read is decoding the buffer as $bodyDecode "; Log3 $name, 4, "$name: Read is decoding the buffer as $bodyDecode ";
} }
my $ppr = AttrVal($name, "preProcessRegex", "");
#my $ppr = AttrVal($name, "preProcessRegex", ""); #my $ppr = HTTPMOD_GetRegex($name, "", "", "preProcessRegex", ""); # klappt so einfach nicht -> intensiveres debugging wegen s// nötig
my $ppr = HTTPMOD_GetRegex($name, "", "", "preProcessRegex", "");
if ($ppr) { if ($ppr) {
my $pprexp = '$body=~' . $ppr; my $pprexp = '$body=~' . $ppr;
my $oldSig = ($SIG{__WARN__} ? $SIG{__WARN__} : 'DEFAULT'); my $oldSig = ($SIG{__WARN__} ? $SIG{__WARN__} : 'DEFAULT');