Merge pull request #88 from ty4tw/develop

Bug Fix of Empty Client Id of CONNECT #86
This commit is contained in:
Tomoaki Yamaguchi
2017-09-28 08:25:42 +09:00
committed by GitHub
9 changed files with 27 additions and 9 deletions

View File

@@ -500,6 +500,7 @@ char* MQTTGWPacket::getMsgId(char* pbuf)
{
case PUBLISH:
Publish pub;
pub.msgId = 0;
getPUBLISH(&pub);
if ( _header.bits.dup )
{

View File

@@ -227,6 +227,16 @@ Client* ClientList::createClient(SensorNetAddress* addr, MQTTSNString* clientId,
{
client->setClientId(*clientId);
}
else
{
MQTTSNString dummyId;
char* id = (char*)malloc(1);
*id = 0;
dummyId.cstring = id;
dummyId.lenstring.len = 0;
client->setClientId(dummyId);
free(id);
}
/* add the list */
if ( _firstClient == 0 )