mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-03 08:25:47 +03:00
resource.c: Further fix making subscribers iteration safe
This commit is contained in:
1 parent
f93b9a3e37
commit
e8052b3988
1 file changed
+8
-2
+8
-2
@@ -1032,14 +1032,20 @@ coap_notify_observers(coap_context_t *context, coap_resource_t *r,
|
||||
mid = coap_send_internal( obs->session, response );
|
||||
|
||||
if (COAP_INVALID_MID == mid) {
|
||||
coap_subscription_t *s;
|
||||
coap_log(LOG_DEBUG,
|
||||
"coap_check_notify: sending failed, resource stays "
|
||||
"partially dirty\n");
|
||||
obs->dirty = 1;
|
||||
LL_FOREACH(r->subscribers, s) {
|
||||
if (s == obs) {
|
||||
/* obs not deleted during coap_send_internal() */
|
||||
obs->dirty = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
r->partiallydirty = 1;
|
||||
context->observe_pending = 1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
r->dirty = 0;
|
||||
|
||||
Reference in new issue
Block a user