[riot-notifications] [RIOT-OS/RIOT] sys/net/gcoap: Use socket _buf API to recognize truncated requests (#16378)

chrysn notifications at github.com
Wed Aug 25 16:28:46 CEST 2021


If a response is received through gcoap it is, as it always has been, copied into gcoap's receive buffer, and freed from the socket. When such a truncated response arrives, the tail is gone for good already.

Sure, we could offer all kinds of "yeah but there's a pointer you can follow up on and need to free" stuff, but the beauty of nanocoap and gcoap is that the user doesn't need to gather data from anywhere, and the beauty of CoAP is that this is not needed in practice.

The point of this is to allow the stack to fail gracefully (allowing the protocol to continue rather than deadlocking it) when overly long messages arrive, which generally means to ask for smaller bites of data. An application will pick its buffer in accordance with the messages it expects, so if someone wants to haul 1KiB messages, they can up their buffer.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16378#issuecomment-905550763
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210825/19af14a9/attachment.htm>


More information about the notifications mailing list