Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clearing SubscriptionList entries in shadowActionAcks after subscription failure #62

Closed
PTaylor-RA opened this issue Dec 20, 2016 · 1 comment
Assignees

Comments

@PTaylor-RA
Copy link

I'm using multiple threads which is probably why I noticed this.

if(clearBothEntriesFromList) {
    if(indexAcceptedSubList >= 0) {
        SubscriptionList[indexAcceptedSubList].isFree = true;
    } else if(indexRejectedSubList >= 0) {
        SubscriptionList[indexRejectedSubList].isFree = true;
    }
    if(SubscriptionList[indexAcceptedSubList].count == 1) {
        aws_iot_mqtt_unsubscribe(pMqttClient, SubscriptionList[indexAcceptedSubList].Topic,
	    (uint16_t)strlen(SubscriptionList[indexAcceptedSubList].Topic));
    }
}

should be:

if(clearBothEntriesFromList) {
    if(indexAcceptedSubList >= 0) {
        SubscriptionList[indexAcceptedSubList].isFree = true;
    }
    if(indexRejectedSubList >= 0) {
        SubscriptionList[indexRejectedSubList].isFree = true;
    }
    if(SubscriptionList[indexAcceptedSubList].count == 1) {
        aws_iot_mqtt_unsubscribe(pMqttClient, SubscriptionList[indexAcceptedSubList].Topic,
									 (uint16_t) strlen(SubscriptionList[indexAcceptedSubList].Topic));
    }
}
@chaurah
Copy link
Contributor

chaurah commented Dec 21, 2016

Hi @PTaylor-RA,
Thank you for pointing this out. I have added this to the list of bug fixes to be included with the next SDK release. I will update and close this issue when the release is out.

Please do let us know if you have any further suggestions.

Rahul

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants