mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-12 11:40:39 +03:00
resource.c: Return 0 if there is no observer to notify.
According to documentation, coap_resource_notify_observers() must return 0 if no observer will be notified. This can help an application release resources associated to that resource for observation.
This commit is contained in:
1 parent
4e73052872
commit
460c7248bb
1 file changed
+2
@@ -827,6 +827,8 @@ coap_resource_notify_observers(coap_resource_t *r, const coap_string_t *query) {
|
||||
if (!found)
|
||||
return 0;
|
||||
} else {
|
||||
if ( !r->subscribers )
|
||||
return 0;
|
||||
r->dirty = 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user