mirror of
https://github.com/obgm/libcoap.git
synced 2026-10-30 22:45:49 +03:00
If multiple clients subscribe to the same resource, one of the clients 'goes away', the server will eventually close down the session for that client which will then remove any subscriptions, iterating through the different resources. If this happens at the same time that coap_resource_notify_observers() is called in another thread, and the GET/FETCH handler is called for a common resource and in particular for the session that is now going away, on return from the callback the subscription may no longer exist. This PR fixes this window. In addition, if the resource subscriber list is being traversed, then a another call to coap_notify_observers() for the same resource will not generate a new set unsolicited observe responses for multi-thread protection. Update