2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

FHEMWEB: Late checking of write-blocking fix

git-svn-id: https://svn.fhem.de/fhem/trunk@4202 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2013-11-11 07:56:11 +00:00
parent e36320295f
commit 70d689b695
3 changed files with 3 additions and 21 deletions

View File

@ -1,6 +1,7 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it. # Do not insert empty lines here, update check depends on it.
- SVN - SVN
- bugfix: fhem.pl: write-select to avoid blocking in inform/Event Monitor
- bugfix: fix issue with DST changes in 57_Calendar.pm - bugfix: fix issue with DST changes in 57_Calendar.pm
- feature: new module 36_LaCrosse.pm for LaCrosse IT+ temperature and - feature: new module 36_LaCrosse.pm for LaCrosse IT+ temperature and
humidity sensors with a JeeLabs JeeLink as RF modem. humidity sensors with a JeeLabs JeeLink as RF modem.

View File

@ -1949,34 +1949,14 @@ FW_Notify($$)
push @data,("$tn $dt $dn ".$dev->{CHANGED}[$i]."<br>"); push @data,("$tn $dt $dn ".$dev->{CHANGED}[$i]."<br>");
} }
} }
} }
if(@data) { if(@data) {
# Collect multiple changes (e.g. from notifiees) into one message addToWritebuffer($ntfy, join("\n", map { s/\n/ /gm; $_ } @data)."\n");
$ntfy->{INFORMBUF} .= join("\n", map { s/\n/ /gm; $_ } @data)."\n";
RemoveInternalTimer($ln);
if(length($ntfy->{INFORMBUF}) > 1024) {
FW_FlushInform($ln);
} else {
InternalTimer(gettimeofday()+0.1, "FW_FlushInform", $ln, 0);
}
} }
return undef; return undef;
} }
sub
FW_FlushInform($)
{
my ($name) = @_;
my $hash = $defs{$name};
return if(!$hash);
my $c = $hash->{CD};
print $c $hash->{INFORMBUF};
$hash->{INFORMBUF}="";
}
################### ###################
# Compute the state (==second) column # Compute the state (==second) column
sub sub

View File

@ -28,6 +28,7 @@ TcpServer_Open($$$)
LocalHost => ($global ? undef : "localhost"), LocalHost => ($global ? undef : "localhost"),
LocalPort => $port, LocalPort => $port,
Listen => 10, Listen => 10,
Blocking => 0, # Needed for .WRITEBUFFER@darwin
ReuseAddr => 1 ReuseAddr => 1
); );
$hash->{STATE} = "Initialized"; $hash->{STATE} = "Initialized";