Update: Set WaitWillMsgFlg before posting Event. to protect repeated

WILLMSG before seending CONNECT.

Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
tomoaki
2016-10-17 10:07:59 +09:00
parent 9de0448130
commit 9b7c25b28c
3 changed files with 2 additions and 2 deletions

View File

@@ -114,7 +114,6 @@ void BrokerSendTask::run()
{
if ( packet->getType() == CONNECT )
{
client->setWaitWillMsgFlg(false);
client->connectSended();
}
log(client, packet);

View File

@@ -200,6 +200,7 @@ void MQTTSNConnectionHandler::handleWillmsg(Client* client, MQTTSNPacket* packet
/* Send CONNECT to the broker */
Event* evt = new Event();
evt->setBrokerSendEvent(client, mqttPacket);
client->setWaitWillMsgFlg(false);
_gateway->getBrokerSendQue()->post(evt);
}
}

View File

@@ -25,7 +25,7 @@ namespace MQTTSNGW
/*=================================
* Starting prompt
==================================*/
#define GATEWAY_VERSION " * Version: 0.9.1"
#define GATEWAY_VERSION " * Version: 0.9.2"
#define PAHO_COPYRIGHT0 " * MQTT-SN Transparent Gateway"
#define PAHO_COPYRIGHT1 " * Part of Project Paho in Eclipse"