diff options
author | Muneeb Ahmed <54290492+muneebahmed10@users.noreply.github.com> | 2020-10-16 10:51:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-16 10:51:23 -0700 |
commit | 806d51caf0e1db234cec1b1c59274c39e2d0f420 (patch) | |
tree | f5d7037d2db81f25f0e3263350d6eb2b4c4a4ef5 /FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Mutual_Auth/DemoTasks/MutualAuthMQTTExample.c | |
parent | d47a28aff7c869f3659fb90a8ccf0cbe3c5e4ac0 (diff) | |
download | freertos-git-806d51caf0e1db234cec1b1c59274c39e2d0f420.tar.gz |
Fix bug allowing an infinite subscribe loop (#348)
* Reset flag in each iteration of subscribe loop
Diffstat (limited to 'FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Mutual_Auth/DemoTasks/MutualAuthMQTTExample.c')
-rw-r--r-- | FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Mutual_Auth/DemoTasks/MutualAuthMQTTExample.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Mutual_Auth/DemoTasks/MutualAuthMQTTExample.c b/FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Mutual_Auth/DemoTasks/MutualAuthMQTTExample.c index 36bd038b2..fe8eb15c4 100644 --- a/FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Mutual_Auth/DemoTasks/MutualAuthMQTTExample.c +++ b/FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Mutual_Auth/DemoTasks/MutualAuthMQTTExample.c @@ -779,6 +779,9 @@ static void prvMQTTSubscribeWithBackoffRetries( MQTTContext_t * pxMQTTContext ) xResult = MQTT_ProcessLoop( pxMQTTContext, mqttexamplePROCESS_LOOP_TIMEOUT_MS ); configASSERT( xResult == MQTTSuccess ); + /* Reset flag before checking suback responses. */ + xFailedSubscribeToTopic = false; + /* Check if recent subscription request has been rejected. #xTopicFilterContext is updated * in the event callback to reflect the status of the SUBACK sent by the broker. It represents * either the QoS level granted by the server upon subscription, or acknowledgement of |