From 7aa50124c270fdc596a39653b7c850ada7ea50e5 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 9 Nov 2025 11:45:03 +0100 Subject: [PATCH] TODO: improve code for large MQTT payloads Closes #19416 --- docs/TODO | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/TODO b/docs/TODO index add6819eae..99e8d1dd60 100644 --- a/docs/TODO +++ b/docs/TODO @@ -180,6 +180,7 @@ 21.1 Support rate-limiting 21.2 Support MQTTS 21.3 Handle network blocks + 21.4 large payloads 22. TFTP 22.1 TFTP does not convert LF to CRLF for mode=netascii @@ -1270,16 +1271,24 @@ 21.3 Handle network blocks - Running test suite with - `CURL_DBG_SOCK_WBLOCK=90 ./runtests.pl -a mqtt` makes several - MQTT test cases fail where they should not. + Running test suite with `CURL_DBG_SOCK_WBLOCK=90 ./runtests.pl -a mqtt` makes + several MQTT test cases fail where they should not. + +21.4 large payloads + + libcurl unnecessarily allocates heap memory to hold the entire payload to get + sent, when the data is already perfectly accessible where it is when + `CURLOPT_POSTFIELDS` is used. This is highly inefficient for larger payloads. + Additionally, libcurl does not support using the read callback for sending + MQTT which is yet another way to avoid having to hold large payload in + memory. 22. TFTP 22.1 TFTP does not convert LF to CRLF for mode=netascii - RFC 3617 defines that an TFTP transfer can be done using "netascii" - mode. curl does not support extracting that mode from the URL nor does it treat + RFC 3617 defines that an TFTP transfer can be done using "netascii" mode. + curl does not support extracting that mode from the URL nor does it treat such transfers specifically. It should probably do LF to CRLF translations for them.