mirror of
https://github.com/FreeRTOS/FreeRTOS.git
synced 2025-12-19 01:55:28 +08:00
Fix bug allowing an infinite subscribe loop (#348)
* Reset flag in each iteration of subscribe loop
This commit is contained in:
@@ -659,6 +659,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
|
||||
|
||||
@@ -713,6 +713,9 @@ static void prvMQTTSubscribeWithBackoffRetries( MQTTContext_t * pxMQTTContext )
|
||||
xResult = MQTT_ProcessLoop( pxMQTTContext, mqttexampleRECEIVE_LOOP_TIMEOUT_MS );
|
||||
configASSERT( xResult == MQTTSuccess );
|
||||
|
||||
/* Reset flag before checking suback responses. */
|
||||
xFailedSubscribeToTopic = false;
|
||||
|
||||
/* Check if the 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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -605,6 +605,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
|
||||
|
||||
@@ -843,6 +843,9 @@ static void prvMQTTSubscribeWithBackoffRetries( Socket_t xMQTTSocket )
|
||||
* processing function everywhere to highlight this fact. */
|
||||
prvMQTTProcessIncomingPacket( xMQTTSocket );
|
||||
|
||||
/* 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
|
||||
|
||||
Reference in New Issue
Block a user