patchlwIP - A Lightweight TCP/IP stack - Patches: patch #10086, mqtt.c : Remove useless...

 
 

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

patch #10086: mqtt.c : Remove useless LWIP_ASSERT_CORE_LOCKED()

Submitter:  Jonathan D <jona>
Submitted:  Wed 07 Jul 2021 08:54:04 AM UTC
   
 
Category:  apps Priority:  5 - Normal
Status:  Wont Do Privacy:  Public
Assigned to:  goldsimon Open/Closed:  Closed
Planned Release:  None

Thu 12 Oct 2023 06:37:17 PM UTC, comment #1: 

The assert might be invalid in the current code, but the asserts define a "contract" to the application. And since we could, in the future, change 'mqtt_client_new()' to call into the core stack, the assertion is valid here (even if not required right now).

That prevents the need to change applications in the future: every "public" (exported) function of the mqtt client asserts that it is called correctly.

And yes, you need to use (UN)LOCK_TCPIP_CORE appropriately.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 07 Jul 2021 08:54:04 AM UTC, original submission:  

In mqtt.c, several LWIP_ASSERT_CORE_LOCKED are irrelevant. The most obvious is in mqtt_client_new which just does a calloc.
I also found that LWIP_ASSERT_CORE_LOCKED in mqtt_client_is_connected and mqtt_set_inpub_callback are useless but they are not included in the patch.

As a sidenote, I have a separate thread to manage MQTT, does this means that each call to function with LWIP_ASSERT_CORE_LOCKED must be surrounded by (UN)LOCK_TCPIP_CORE ?

Jonathan D <jona>

 

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

Attached Files

 

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 jona (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
    2023-10-12 goldsimon StatusNone Wont Do
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2021-07-07 jona Attached File- Added 0001-mqtt.c-Remove-useless-LWIP_ASSERT_CORE_LOCKED.patch, #51657

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code