00_MQTT2_SERVER.pm: Dispatch LWT (Forum #90145)

git-svn-id: https://svn.fhem.de/fhem/trunk@17173 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2018-08-19 09:10:43 +00:00
parent 7c27c176d4
commit 39d19300ff

View File

@ -102,7 +102,7 @@ MQTT2_SERVER_Undef($@)
if($hash->{lwt}) { # Last will
my ($tp, $val) = split(':', $hash->{lwt}, 2);
MQTT2_SERVER_doPublish($shash, $shash, $tp, $val, $hash->{cflags} & 0x20);
MQTT2_SERVER_doPublish($hash, $shash, $tp, $val, $hash->{cflags} & 0x20);
}
return $ret;
}
@ -346,6 +346,7 @@ MQTT2_SERVER_Read($@)
######################################
# Call sendto for all clients + Dispatch + dotrigger if rawEvents is set
# tgt is the "accept" server, src is the connection generating the data
sub
MQTT2_SERVER_doPublish($$$$;$)
{
@ -363,7 +364,7 @@ MQTT2_SERVER_doPublish($$$$;$)
MQTT2_SERVER_sendto($defs{$clName}, $tp, $val) if($src->{NAME} ne $clName);
}
if($src->{cid}) { # "real" MQTT client
if(defined($src->{cid})) { # "real" MQTT client
my $cid = $src->{cid};
$cid =~ s,[^a-z0-9._],_,gi;
my $ac = AttrVal($tgt->{NAME}, "autocreate", undef) ? "autocreate:":"";