buglwIP - A Lightweight TCP/IP stack - Bugs: bug #56022, MQTT: PINGREQ check wrong

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #56022: MQTT: PINGREQ check wrong

Submitter:  Giuseppe Modugno <giusloq>
Submitted:  Thu 28 Mar 2019 04:17:35 PM UTC
   
 
Category:  apps Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  git head

Tue 11 Jun 2019 07:14:49 PM UTC, comment #1: 

Fixxed with patch #9813.

Simon Goldschmidt <goldsimon>
Group administrator
Thu 28 Mar 2019 04:17:35 PM UTC, original submission:  

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.

Giuseppe Modugno <giusloq>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by giusloq (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-06-11 goldsimon Item GroupNone Faulty Behaviour
        StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code