PelionIoT / mbed-coap

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

Fix duplicate handling block2 #112

Closed teetak01 closed 4 years ago

teetak01 commented 4 years ago

BLOCK2 code-branch was missing handling for duplicate packets. As part of the fix, added also a call to update the duplicate package data via a new function sn_coap_protocol_update_duplicate_package_data_all.

The new implementation handles all CoAP messages, not just those with COAP_MSG_TYPE_ACKNOWLEDGEMENT.

Future improvement could optimize the code further to specifically handle what messages get added to the duplication list, and combine the implementations for update_duplicate_package_data functions.

Fix unit tests for sn_protocol

handle the extra malloc due to change in list update function

teetak01 commented 4 years ago

future improvement could to consolidate some of the duplicate handling inside sn_coap_builder_2.