net: lwm2m: update client tx timestamp before sending message
Update client tx timestamp right after message is added to list of outgoing messages. Delay between when message is generated and sent is negligible. This will prevents bugs that appear when using queue mode, where internal engine logic depends on timestamp being updated when message is generated. Signed-off-by: Marin Jurjević <marin.jurjevic@hotmail.com>
This commit is contained in:
parent
03231fba95
commit
0ab6bc6626
1 changed files with 6 additions and 5 deletions
|
@ -1421,6 +1421,12 @@ cleanup:
|
|||
int lwm2m_send_message_async(struct lwm2m_message *msg)
|
||||
{
|
||||
sys_slist_append(&msg->ctx->pending_sends, &msg->node);
|
||||
|
||||
if (IS_ENABLED(CONFIG_LWM2M_RD_CLIENT_SUPPORT) &&
|
||||
IS_ENABLED(CONFIG_LWM2M_QUEUE_MODE_ENABLED)) {
|
||||
engine_update_tx_time();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1452,11 +1458,6 @@ static int lwm2m_send_message(struct lwm2m_message *msg)
|
|||
lwm2m_reset_message(msg, true);
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_LWM2M_RD_CLIENT_SUPPORT) &&
|
||||
IS_ENABLED(CONFIG_LWM2M_QUEUE_MODE_ENABLED)) {
|
||||
engine_update_tx_time();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue