mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-13 23:46:51 +01:00
Merge pull request #88 from ty4tw/develop
Bug Fix of Empty Client Id of CONNECT #86
This commit is contained in:
@@ -500,6 +500,7 @@ char* MQTTGWPacket::getMsgId(char* pbuf)
|
||||
{
|
||||
case PUBLISH:
|
||||
Publish pub;
|
||||
pub.msgId = 0;
|
||||
getPUBLISH(&pub);
|
||||
if ( _header.bits.dup )
|
||||
{
|
||||
|
||||
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user