Merge pull request #235 from mrdeep1/observe-con

src/resource.c: Non Confirmable observe requests not getting out if CON pending
This commit is contained in:
obgm authored and GitHub committed 2018-09-24 16:25:03 +02:00
commit e758f338c5
1 file changed
+7 -2
+7 -2
View File
@@ -742,9 +742,14 @@ coap_notify_observers(coap_context_t *context, coap_resource_t *r) {
LL_FOREACH(r->subscribers, obs) {
if (r->dirty == 0 && obs->dirty == 0)
/* running this resource due to partiallydirty, but this observation's notification was already enqueued */
/*
* running this resource due to partiallydirty, but this observation's
* notification was already enqueued
*/
continue;
if (obs->session->con_active >= COAP_DEFAULT_NSTART)
if (obs->session->con_active >= COAP_DEFAULT_NSTART &&
((r->flags & COAP_RESOURCE_FLAGS_NOTIFY_CON) ||
(obs->non_cnt >= COAP_OBS_MAX_NON)))
continue;
coap_tid_t tid = COAP_INVALID_TID;