mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-15 08:26:51 +01:00
Bugfix of #238
This reverts commit 69fd222d6070a5e9ec02c90b03a7bb0671ca0db0.
This commit is contained in:
@@ -42,6 +42,7 @@ MQTTGWPacket* MQTTSNPublishHandler::handlePublish(Client* client,
|
|||||||
int qos;
|
int qos;
|
||||||
uint8_t retained;
|
uint8_t retained;
|
||||||
uint16_t msgId;
|
uint16_t msgId;
|
||||||
|
uint16_t tid;
|
||||||
uint8_t* payload;
|
uint8_t* payload;
|
||||||
MQTTSN_topicid topicid;
|
MQTTSN_topicid topicid;
|
||||||
int payloadlen;
|
int payloadlen;
|
||||||
@@ -69,6 +70,7 @@ MQTTGWPacket* MQTTSNPublishHandler::handlePublish(Client* client,
|
|||||||
pub.header.bits.dup = dup;
|
pub.header.bits.dup = dup;
|
||||||
pub.header.bits.qos = (qos == 3 ? 0 : qos);
|
pub.header.bits.qos = (qos == 3 ? 0 : qos);
|
||||||
pub.header.bits.retain = retained;
|
pub.header.bits.retain = retained;
|
||||||
|
tid = topicid.data.id;
|
||||||
|
|
||||||
Topic* topic = nullptr;
|
Topic* topic = nullptr;
|
||||||
|
|
||||||
@@ -128,7 +130,7 @@ MQTTGWPacket* MQTTSNPublishHandler::handlePublish(Client* client,
|
|||||||
/* Save a msgId & a TopicId pare for PUBACK */
|
/* Save a msgId & a TopicId pare for PUBACK */
|
||||||
if (msgId && qos > 0 && qos < 3)
|
if (msgId && qos > 0 && qos < 3)
|
||||||
{
|
{
|
||||||
client->setWaitedPubTopicId(msgId, topicid.data.id, &topicid);
|
client->setWaitedPubTopicId(msgId, tid, &topicid);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub.payload = (char*) payload;
|
pub.payload = (char*) payload;
|
||||||
|
|||||||
Reference in New Issue
Block a user