From 34f8b8c2d5bb1ae7ed7ef8644a6bfd9585761320 Mon Sep 17 00:00:00 2001 From: Kyunghwan Kwon Date: Fri, 2 Dec 2022 14:45:03 +0900 Subject: [PATCH 1/2] Fix to update the timestamp of the last packet received --- docs/doxygen/include/size_table.md | 4 ++-- source/core_mqtt.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/doxygen/include/size_table.md b/docs/doxygen/include/size_table.md index cb33d24c8..10de57852 100644 --- a/docs/doxygen/include/size_table.md +++ b/docs/doxygen/include/size_table.md @@ -10,7 +10,7 @@ core_mqtt.c
4.1K
-
3.4K
+
3.5K
core_mqtt_state.c @@ -25,6 +25,6 @@ Total estimates
8.6K
-
6.9K
+
7.0K
diff --git a/source/core_mqtt.c b/source/core_mqtt.c index 9a66ec1b3..9cdf5e8cd 100644 --- a/source/core_mqtt.c +++ b/source/core_mqtt.c @@ -1763,6 +1763,8 @@ static MQTTStatus_t receiveSingleIteration( MQTTContext_t * pContext, ( void ) memmove( pContext->networkBuffer.pBuffer, &( pContext->networkBuffer.pBuffer[ totalMQTTPacketLength ] ), pContext->index ); + + pContext->lastPacketRxTime = pContext->getTime(); } if( status == MQTTNoDataAvailable ) From 52c4b0662085a9c1e0c5ce610d1da61bd8150bbb Mon Sep 17 00:00:00 2001 From: Kyunghwan Kwon Date: Mon, 12 Dec 2022 19:18:29 +0900 Subject: [PATCH 2/2] Update source/core_mqtt.c Co-authored-by: Paul Bartell --- source/core_mqtt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/core_mqtt.c b/source/core_mqtt.c index 9cdf5e8cd..3cdafafd7 100644 --- a/source/core_mqtt.c +++ b/source/core_mqtt.c @@ -1764,7 +1764,10 @@ static MQTTStatus_t receiveSingleIteration( MQTTContext_t * pContext, &( pContext->networkBuffer.pBuffer[ totalMQTTPacketLength ] ), pContext->index ); - pContext->lastPacketRxTime = pContext->getTime(); + if( status == MQTTSuccess ) + { + pContext->lastPacketRxTime = pContext->getTime(); + } } if( status == MQTTNoDataAvailable )