BugFix of Issue #45

Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
tomoaki
2017-01-18 09:54:07 +09:00
parent e05d205843
commit 7ac0d89fb1

View File

@@ -63,9 +63,8 @@ void MQTTGWPublishHandler::handlePublish(Client* client, MQTTGWPacket* packet)
topicId.data.long_.len = pub.topiclen;
topicId.data.long_.name = pub.topic;
id = client->getTopics()->getTopicId(&topicId);
}
if (id > 0)
if ( id > 0 )
{
topicId.data.id = id;
}
@@ -127,11 +126,13 @@ void MQTTGWPublishHandler::handlePublish(Client* client, MQTTGWPacket* packet)
else
{
WRITELOG("\x1b[0m\x1b[31mMQTTGWPublishHandler Can't create a Topic.\n");
delete snPacket;
return;
}
}
}
/* TopicId was aquired. */
/* TopicId was acquired. */
if (client->isSleep())
{
/* client is sleeping. save PUBLISH */