Skip to content

Commit 609aa69

Browse files
committed
Fix f804 - do not truncate retained message length
1 parent a812487 commit 609aa69

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/mqtt_broker.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,7 +1756,7 @@ static void BrokerSubs_ReassociateClient(MqttBroker* broker,
17561756
/* -------------------------------------------------------------------------- */
17571757
#ifdef WOLFMQTT_BROKER_RETAINED
17581758
static int BrokerRetained_Store(MqttBroker* broker, const char* topic,
1759-
const byte* payload, word16 payload_len, word32 expiry_sec)
1759+
const byte* payload, word32 payload_len, word32 expiry_sec)
17601760
{
17611761
BrokerRetainedMsg* msg = NULL;
17621762
int rc = MQTT_CODE_SUCCESS;
@@ -3079,7 +3079,7 @@ static int BrokerHandle_Publish(BrokerClient* bc, int rx_len,
30793079
}
30803080
#endif
30813081
(void)BrokerRetained_Store(broker, topic, payload,
3082-
(word16)pub.total_len, expiry);
3082+
pub.total_len, expiry);
30833083
}
30843084
}
30853085
#endif /* WOLFMQTT_BROKER_RETAINED */

wolfmqtt/mqtt_broker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ typedef struct BrokerRetainedMsg {
276276
byte* payload;
277277
struct BrokerRetainedMsg* next;
278278
#endif
279-
word16 payload_len;
279+
word32 payload_len;
280280
WOLFMQTT_BROKER_TIME_T store_time; /* when stored (seconds) */
281281
word32 expiry_sec; /* v5 message expiry (0=none) */
282282
} BrokerRetainedMsg;

0 commit comments

Comments
 (0)