Closed perigoso closed 2 years ago
Yeah, this really was an odd choice -- you've just gotten disconnected from the broker, what makes you so sure that your next reconnection, likely just seconds afterwards, will succeed? The reconnect_callback caller should've been able to deal with failures, without needing the callback itself to block until success.
Wonder if it'll be as simple as modifying the callback to return a bool and then an early return in mqtt_sync()
if the callback fails.
Like i said i already provided a fix, tested and working on real world application
If within the reconnect callback something fails, and the function returns without correctly initializing the socket and calling connect, the sync continues as if nothing wrong happened, in cases where the socket initialization failed this could mean bad memory accesses in
recv
A fix is included in #149