Fixed triggers only prefix-matching on stream names

This commit is contained in:
Thulinma 2016-10-11 13:19:31 +02:00
parent 55f1c539ad
commit 46703ad50d

View file

@ -199,7 +199,8 @@ bool doTrigger(const std::string type, const std::string &payload, const std::st
while( totalLen>((unsigned int)(bytepos-startBytepos)) ){ while( totalLen>((unsigned int)(bytepos-startBytepos)) ){
unsigned int stringLen=((unsigned int *)bytepos)[0]; unsigned int stringLen=((unsigned int *)bytepos)[0];
bytepos+=4; bytepos+=4;
if (strncmp(bytepos, streamName.c_str(), stringLen) == 0){ size_t splitter = streamName.find_first_of("+ ");
if ((streamName.size() == stringLen || splitter == stringLen) && strncmp(bytepos, streamName.c_str(), stringLen) == 0){
isHandled = true; isHandled = true;
} }
bytepos+=stringLen; bytepos+=stringLen;