Fix bug allowing an infinite subscribe loop (#348)

* Reset flag in each iteration of subscribe loop
pull/317/head
Muneeb Ahmed 4 years ago committed by GitHub
parent d47a28aff7
commit 806d51caf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

Loading…
Cancel
Save