net: lwm2m: Fix socket hints for block transfer
Outgoing block-transfers now set the socket hint to ONGOING as long as the BLOCK1/BLOCK2 header has MORE flag set to true. This means as only the last packet in the block-transfer set the socket hint to LAST or ONE_RESPONSE. Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
This commit is contained in:
parent
b0339136c1
commit
c62dd778cd
5 changed files with 31 additions and 1 deletions
|
@ -43,6 +43,7 @@ DEFINE_FAKE_VOID_FUNC(lwm2m_clear_block_contexts);
|
|||
DEFINE_FAKE_VALUE_FUNC(int, lwm2m_security_mode, struct lwm2m_ctx *);
|
||||
DEFINE_FAKE_VALUE_FUNC(int, z_impl_zsock_setsockopt, int, int, int, const void *, socklen_t);
|
||||
DEFINE_FAKE_VOID_FUNC(engine_update_tx_time);
|
||||
DEFINE_FAKE_VALUE_FUNC(bool, coap_block_has_more, struct coap_packet *);
|
||||
|
||||
static sys_slist_t obs_obj_path_list = SYS_SLIST_STATIC_INIT(&obs_obj_path_list);
|
||||
sys_slist_t *lwm2m_obs_obj_path_list(void)
|
||||
|
|
|
@ -58,6 +58,7 @@ DECLARE_FAKE_VALUE_FUNC(int, z_impl_zsock_connect, int, const struct sockaddr *,
|
|||
DECLARE_FAKE_VALUE_FUNC(int, lwm2m_security_mode, struct lwm2m_ctx *);
|
||||
DECLARE_FAKE_VALUE_FUNC(int, z_impl_zsock_setsockopt, int, int, int, const void *, socklen_t);
|
||||
DECLARE_FAKE_VOID_FUNC(engine_update_tx_time);
|
||||
DECLARE_FAKE_VALUE_FUNC(bool, coap_block_has_more, struct coap_packet *);
|
||||
|
||||
#define DO_FOREACH_FAKE(FUNC) \
|
||||
do { \
|
||||
|
@ -89,6 +90,7 @@ DECLARE_FAKE_VOID_FUNC(engine_update_tx_time);
|
|||
FUNC(lwm2m_security_mode) \
|
||||
FUNC(z_impl_zsock_setsockopt) \
|
||||
FUNC(engine_update_tx_time) \
|
||||
FUNC(coap_block_has_more) \
|
||||
} while (0)
|
||||
|
||||
#endif /* STUBS_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue