buglwIP - A Lightweight TCP/IP stack - Bugs: bug #65257, MQTT fragmentation is not working...

 
 

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

bug #65257: MQTT fragmentation is not working correctly

Submitter:  Embitz <embitz>
Submitted:  Mon 05 Feb 2024 08:03:19 AM UTC
   
 
Category:  apps Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
lwIP version:  2.1.1

Tue 06 Feb 2024 05:41:07 AM UTC, comment #1: 

The file upload is working so I attached my files.

Modifications:
- Mqtt Client struct added with multiple extra fields for incoming state saving between incoming tcp segments.
- mqtt_incoming_parser function is modified to handle segmented messages.


With these modifications I'm able to send firmware updates from approx 800Kbyte in one message.

Embitz <embitz>
Mon 05 Feb 2024 08:03:19 AM UTC, original submission:  

The current MQTT client 3.1.1 is not capable of receiving fragmented messages.

If your total message length (header+payload) exceeds the input buffer length or the maximum TCP segment size, then MQTT fails to function correctly. This could be a problem if you want to send larger messages or if the sending party decides to reduce the maximum TCP segment size.

The solution presented here does not pretend to be the most beautiful or smartest solution, but a solution with as few adjustments as possible to the original.

Attaching files here doesn't work for me (re-attach???) but the files and more info are here:

https://embitz.org/forum/thread-188.html

Embitz <embitz>

 

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

Attached Files
file #55672:  mqtt.c added by embitz (52KiB - application/octet-stream - Any size incoming message in any size rx buffer)
file #55673:  mqtt_priv.h added by embitz (3KiB - application/octet-stream - Any size incoming message in any size rx buffer)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by embitz (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-02-06 embitz Attached File- Added mqtt.c, #55672
        Attached File- Added mqtt_priv.h, #55673

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code