mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-07 15:04:39 +08:00
mqtt: fix ping request coming too late
See bug #56022 and patch #9813 Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
parent
b3a939417e
commit
edeeef0d20
@ -603,14 +603,13 @@ mqtt_cyclic_timer(void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If time for a keep alive message to be sent, transmission has been idle for keep_alive time */
|
/* If time for a keep alive message to be sent, transmission has been idle for keep_alive time */
|
||||||
|
client->cyclic_tick++;
|
||||||
if ((client->cyclic_tick * MQTT_CYCLIC_TIMER_INTERVAL) >= client->keep_alive) {
|
if ((client->cyclic_tick * MQTT_CYCLIC_TIMER_INTERVAL) >= client->keep_alive) {
|
||||||
LWIP_DEBUGF(MQTT_DEBUG_TRACE, ("mqtt_cyclic_timer: Sending keep-alive message to server\n"));
|
LWIP_DEBUGF(MQTT_DEBUG_TRACE, ("mqtt_cyclic_timer: Sending keep-alive message to server\n"));
|
||||||
if (mqtt_output_check_space(&client->output, 0) != 0) {
|
if (mqtt_output_check_space(&client->output, 0) != 0) {
|
||||||
mqtt_output_append_fixed_header(&client->output, MQTT_MSG_TYPE_PINGREQ, 0, 0, 0, 0);
|
mqtt_output_append_fixed_header(&client->output, MQTT_MSG_TYPE_PINGREQ, 0, 0, 0, 0);
|
||||||
client->cyclic_tick = 0;
|
client->cyclic_tick = 0;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
client->cyclic_tick++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user