zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.88k stars 6.63k forks source link

net: lwm2m: send callback behavior on blockwise operation #64290

Closed RomainPelletant closed 1 year ago

RomainPelletant commented 1 year ago

Describe the bug Initiate blockwise operation on send method will never call send callback.

To Reproduce Steps to reproduce the behavior:

  1. Enable blockwise feature
  2. send data greater than COAP BLOCK SIZE and register send callback

Expected behavior The send callback shall be called to get send result

Environment (please complete the following information):

henrikbrixandersen commented 1 year ago

Please submit code change proposals as pull requests, not patches attached to issues.

rlubos commented 1 year ago

Isn't the CONTINUE code already handled at the CoAP library level, so that the reply callback is only called on the final block response? For reference: https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/net/lib/coap/coap.c#L1744

Also I don't think I follow the user data change, isn't struct lwm2m_message preserved for the consecutive blocks? CC @SeppoTakalo

SeppoTakalo commented 1 year ago

I see.. build_msg_block_for_send() will reset the message structure, and get rid of CoAP reply structure that was having the user_data pointer.