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:
jcmichelou authored and Olaf Bergmann committed 2018-09-24 15:42:40 +02:00
1 parent 4e73052872
commit 460c7248bb
1 file changed
+2
+2
View File
@@ -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;
}