mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-05 17:32:54 +03:00
Only requiring an observervable resource to have a GET handler, if it is in fact an observable resource
Signed-off-by: Olaf Bergmann <bergmann@tzi.org>
This commit is contained in:
1 parent
b966a0c834
commit
85ea3eebc7
1 file changed
+6
-5
+6
-5
@@ -632,13 +632,14 @@ coap_notify_observers(coap_context_t *context, coap_resource_t *r) {
|
||||
str token;
|
||||
coap_pdu_t *response;
|
||||
|
||||
/* retrieve GET handler, prepare response */
|
||||
h = r->handler[COAP_REQUEST_GET - 1];
|
||||
assert(h); /* we do not allow subscriptions if no
|
||||
* GET handler is defined */
|
||||
|
||||
if (r->observable && (r->dirty || r->partiallydirty)) {
|
||||
r->partiallydirty = 0;
|
||||
|
||||
/* retrieve GET handler, prepare response */
|
||||
h = r->handler[COAP_REQUEST_GET - 1];
|
||||
assert(h); /* we do not allow subscriptions if no
|
||||
* GET handler is defined */
|
||||
|
||||
for (obs = list_head(r->subscribers); obs; obs = list_item_next(obs)) {
|
||||
if (r->dirty == 0 && obs->dirty == 0)
|
||||
/* running this resource due to partiallydirty, but this observation's notification was already enqueued */
|
||||
|
||||
Reference in new issue
Block a user