mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-14 16:06:51 +01:00
BugFix: MQTTSNDeserialize_XXXX() functions don't return error code when
error occurs. Do not store the length of packet into rc. If the packet is incorrect, skip the processing that follows. Bugfix: Print out the value of TopicId in SUBACK and UNSUBACK. Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
@@ -41,7 +41,10 @@ void MQTTSNSubscribeHandler::handleSubscribe(Client* client, MQTTSNPacket* packe
|
||||
MQTTSN_topicid topicFilter;
|
||||
Topic* topic = 0;
|
||||
|
||||
packet->getSUBSCRIBE(&dup, &qos, &msgId, &topicFilter);
|
||||
if ( packet->getSUBSCRIBE(&dup, &qos, &msgId, &topicFilter) == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (topicFilter.type <= MQTTSN_TOPIC_TYPE_SHORT)
|
||||
{
|
||||
@@ -139,7 +142,10 @@ void MQTTSNSubscribeHandler::handleUnsubscribe(Client* client, MQTTSNPacket* pac
|
||||
uint16_t msgId;
|
||||
MQTTSN_topicid topicFilter;
|
||||
|
||||
packet->getUNSUBSCRIBE(&msgId, &topicFilter);
|
||||
if ( packet->getUNSUBSCRIBE(&msgId, &topicFilter) == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( topicFilter.type == MQTTSN_TOPIC_TYPE_PREDEFINED )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user