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

mqtt_start_receive_schedule will loop forever if read_len < 0; #144

Open
shenfumin opened this issue Sep 2, 2017 · 0 comments
Open

mqtt_start_receive_schedule will loop forever if read_len < 0; #144

shenfumin opened this issue Sep 2, 2017 · 0 comments

Comments

@shenfumin
Copy link

shenfumin commented Sep 2, 2017

in the function mqtt_start_receive_schedule, if read_len < 0, it will loop forever and not jump out the loop.
while (1) {

    read_len = ClientRead(client->mqtt_state.in_buffer, CONFIG_MQTT_BUFFER_SIZE_BYTE);
    mqtt_info("Read len %d", read_len);
    if (read_len == 0)
        break;
    .......

}
how to fix it?
i had tried the following change
if (read_len <= 0)
break;
it could work normally. but i am not sure. anyboady found this issue or have some idea?

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