2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-21 01:46:08 +00:00

FHEMWEB: plotfork ist not hardcoded, checks for the FORKABLE FWEXT hash entry

git-svn-id: https://svn.fhem.de/fhem/trunk@6542 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2014-09-12 09:03:55 +00:00
parent e70e2872bf
commit 823c187ae3
3 changed files with 8 additions and 4 deletions

View File

@ -372,10 +372,14 @@ FW_Read($)
$arg = "" if(!defined($arg));
Log3 $FW_wname, 4, "HTTP $name GET $arg";
$FW_ME = "/" . AttrVal($FW_wname, "webname", "fhem");
my $pid;
if(AttrVal($FW_wname, "plotfork", undef)) {
# Process SVG rendering as a parallel process
return if(($arg =~ m+/SVG_showLog+) && ($pid = fork));
my $p = $data{FWEXT};
if(grep { $p->{$_}{FORKABLE} && $arg =~ m+^$FW_ME$_+ } keys %{$p}) {
return if($pid = fork);
}
}
my $cacheable = FW_answerCall($arg);
@ -437,7 +441,6 @@ FW_answerCall($)
$FW_RET = "";
$FW_RETTYPE = "text/html; charset=$FW_encoding";
$FW_ME = "/" . AttrVal($FW_wname, "webname", "fhem");
$FW_CSRF = ($defs{$FW_wname}{CSRFTOKEN} ?
"&fwcsrf=".$defs{$FW_wname}{CSRFTOKEN} : "");

View File

@ -55,6 +55,7 @@ SVG_Initialize($)
$hash->{FW_atPageEnd} = 1;
$data{FWEXT}{"/SVG_WriteGplot"}{CONTENTFUNC} = "SVG_WriteGplot";
$data{FWEXT}{"/SVG_showLog"}{FUNC} = "SVG_showLog";
$data{FWEXT}{"/SVG_showLog"}{FORKABLE} = 1;
}
#####################################

View File

@ -2344,8 +2344,8 @@ CommandSetstate($$)
} else {
# The timestamp is not the correct one, but we do not store a timestamp for
# this reading.
# The timestamp is not the correct one, but we do not store a timestamp
# for this reading.
my $tn = TimeNow();
$oldvalue{$sdev}{TIME} = $tn;
$oldvalue{$sdev}{VAL} = ($init_done ? $d->{STATE} : $a[1]);