[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #56022] MQTT: PINGREQ check wrong
From: |
Giuseppe Modugno |
Subject: |
[lwip-devel] [bug #56022] MQTT: PINGREQ check wrong |
Date: |
Thu, 28 Mar 2019 12:17:37 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36 |
URL:
<https://savannah.nongnu.org/bugs/?56022>
Summary: MQTT: PINGREQ check wrong
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: giusloq
Submitted on: Thu 28 Mar 2019 04:17:35 PM UTC
Category: apps
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
lwIP version: git head
_______________________________________________________
Details:
In mqtt_cyclic_timer() you check if it's time to send a new PINGREQ, based on
client->keep_alive and client->cyclick_tick.
The if statement is:
if ((client->cyclic_tick * MQTT_CYCLIC_TIMER_INTERVAL) >= client->keep_alive)
{
After connection mqtt_cyclic_timer() is fired after
MQTT_CYCLIC_TIMER_INTERVAL. Now suppose MQTT_CYCLIC_TIMER_INTERVAL is 5
seconds and client->keep_alive is 5 seconds. The first time
mqtt_cyclic_timer() is called, it should send PINGREQ. However it doesn't,
because client->cyclic_tick is zero.
I think it's better to preincrement client->cyclic_tick to take into account
the first period that was already expired. Of course, the increment of
client->cyclic_tick should be deleted on the else branch.
_______________________________________________________
Reply to this item at:
<https://savannah.nongnu.org/bugs/?56022>
_______________________________________________
Message sent via Savannah
https://savannah.nongnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lwip-devel] [bug #56022] MQTT: PINGREQ check wrong,
Giuseppe Modugno <=