mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-02 16:05:50 +03:00
const coap_pdu_t * parameters are passed into application (call-back handler) code. If the application code then calls a libcoap API with a const coap_pdu_t * parameter, it is not possible to increment the reference counter so that multiple entities can reference the same PDU and an entity's call to coap_delete_pdu() does not prematurely remove the PDU until all the entities have finished. This code allows the (const) PDU's reference counter to be incremented.