PelionIoT / mbed-coap

CoAP C library - Builder and Parser for CoAP messages
Apache License 2.0
29 stars 16 forks source link

Invalid blockwise message stored #125

Open ghseb opened 3 years ago

ghseb commented 3 years ago

Hello,

the following section does store a message copy in linked_list_blockwise_sent_msgs even if the message that is sent is no block-wise message (e.g. a COAP_MSG_CODE_REQUEST_POST used for registration updates). I'm not sure if this is actually a bug, but maybe someone knows details on this.

https://github.com/ARMmbed/mbed-coap/blob/c9b32f8a790dcf7f52444041789c73555d88e581/source/sn_coap_protocol.c#L508-L515

Regards, Sebastian

ghseb commented 3 years ago

In a earlier version there is a hint why those non-blockwise messages are stored, I'm not sure if it is valid though: https://github.com/ARMmbed/mbed-coap/commit/aa17c223ddc9aeeca4352477c5a76d735c931643#diff-3f84b9912a0229ef13dff4882aff64b142dfaf05565e4d5101389ba59b100760L543

/* Add message to linked list - response can be in blocks and we need header to build response.. */