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

Possible bug in MQTT_CLIENT_TRY_PACK macro #155

Open
gyavolo opened this issue Jan 21, 2022 · 0 comments
Open

Possible bug in MQTT_CLIENT_TRY_PACK macro #155

gyavolo opened this issue Jan 21, 2022 · 0 comments

Comments

@gyavolo
Copy link

gyavolo commented Jan 21, 2022

#define MQTT_CLIENT_TRY_PACK(tmp, msg, client, pack_call, release)  \
    if (client->error < 0) {                                        \
        if (release) MQTT_PAL_MUTEX_UNLOCK(&client->mutex);         \
        return client->error;                                       \
    }                                                               \

I think it should be:

if (client->error < 0 && client->error != MQTT_ERROR_SEND_BUFFER_IS_FULL) { \

otherwise one buffer full state will cause subsequent messages to fail without trying.

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

No branches or pull requests

1 participant