Generate the QoSm1Proxy Name from the Gateway Id.

Bugfix of AggregatePublish
Memory leak of ClientList

Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
tomoaki
2018-08-14 08:11:11 +09:00
parent 97cffe4573
commit 9de1dc3705
9 changed files with 32 additions and 46 deletions

View File

@@ -58,7 +58,6 @@ void ClientRecvTask::initialize(int argc, char** argv)
void ClientRecvTask::run()
{
Event* ev = nullptr;
Client* client = nullptr;
AdapterManager* adpMgr = _gateway->getAdapterManager();
QoSm1Proxy* qosm1Proxy = adpMgr->getQoSm1Proxy();
bool isAggrActive = adpMgr->isAggregaterActive();
@@ -69,6 +68,7 @@ void ClientRecvTask::run()
while (true)
{
Client* client = nullptr;
Forwarder* fwd = nullptr;
WirelessNodeId nodeId;
@@ -105,7 +105,6 @@ void ClientRecvTask::run()
}
Client* client = nullptr;
SensorNetAddress* senderAddr = _gateway->getSensorNetwork()->getSenderAddress();
if ( packet->getType() == MQTTSN_ENCAPSULATED )
@@ -124,12 +123,6 @@ void ClientRecvTask::run()
nodeId.setId( encap.getWirelessNodeId() );
client = fwd->getClient(&nodeId);
packet = encap.getMQTTSNPacket();
if ( client == nullptr )
{
/* get client of Forwarder or QoSm1Proxy */
client = _gateway->getClientList()->getClient(senderAddr);
}
}
}
else
@@ -138,8 +131,7 @@ void ClientRecvTask::run()
if ( qosm1Proxy->isActive() )
{
/* get ClientId not Client which can send QoS-1 PUBLISH */
const char* clientName = qosm1Proxy->getClientId(senderAddr);
const char* clientName = qosm1Proxy->getClientId(senderAddr);
if ( clientName )
{
@@ -152,13 +144,11 @@ void ClientRecvTask::run()
continue;
}
}
else
{
client = _gateway->getClientList()->getClient(senderAddr);
}
}
}
client = _gateway->getClientList()->getClient(senderAddr);
if ( client )
{
/* write log and post Event */