Closed paulkeogh closed 8 years ago
Yes it is. Thanks for spotting this. I will fix this.
Regarding the server holding a reference to a client, this can also happens if the connection is lost or if the client exits without deregistering. Note this is handled in the protocol by the lifetime mechanism: the registration is valid for a duration specified in the Server object's lifetime resource. If it is not updated by the client, the server drops the registration. This is not implemented yet in liblwm2m.
Project moved to http://github.com/eclipse/wakaama
Hi,
I think there may be an issue with client dereg. Consider the use case where a client registers and immediately deregisters (for whatever reason). There is a possibility that the client will not have handled the registration response from the server and hence not updated the status of the lwm2m_server_t instance to STATE_REGISTERED.
Consequently the deregistration by client will fail because in registration.c/registration_deregister() there is a line;
if (serverP->status != STATE_REGISTERED) return;
Which causes the function to return without sending the dereg command. The server is then left holding a reference to a client.
Is this a valid use case ?