-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
I noticed some weirdness in the mqtt_run function. Specifically:
-
in the condition of the while loop
I don't thinknetwork-stack/lib/mqtt/mqtt.cc
Line 1115 in a7314f9
} while (t->remaining > 0 && status != MQTTSuccess); status != MQTT_Successis ever true because if it were we would've hit one of the return statements above. This means the loop always executes exactly once, so what's the point of having a loop?! For the same reason I don't think the return atis ever reachable so the function will never returnnetwork-stack/lib/mqtt/mqtt.cc
Line 1119 in a7314f9
return -ETIMEDOUT; -ETIMEDOUT. -
Relatedly, although the function takes a Timeout and elapses it, it will call
MQTT_ProcessLoop(which I presume may block?) even iftimeout->may_block()is false. Is this the correct behaviour?
I noticed this because this function is called in a loop in the Hugh demo here and I noticed that it never timed out in long runs even though the timeout was never reset. This is harmless in this case and actually what we want, but it's weird.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels