aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-export.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2019-07-16 23:39:27 +0200
committerJose Bollo <jose.bollo@iot.bzh>2019-07-18 15:39:52 +0200
commit037157919df0a7ee90837037748a6456431e6469 (patch)
treea33e3494a78052b73aea06b694b98298ea04de36 /src/afb-export.c
parenta445694bda8773cb80566808b5dcb56f033dee58 (diff)
Tag broadcasted events with UUID and hop
When API have mutual dependencies, leading to loops in dependecies, broadcasting an event never ends because of the loop (see SPEC-2625). To avoid that weird flood of events, a unic identifier (UUID) is attached to broadcasted event and a tiny memory records previously broadcasted events to avoid re-sending an already sent event. The size of the memory can be set using the macro variable EVENT_BROADCAST_MEMORY_COUNT whose default value is 8. It can be reduced to 0. An other mecanism is added to limit the count of hops that a broadcasted event can do. That count can be set using the macro variable EVENT_BROADCAST_HOP_MAX whose default value is 10. Bug-AGL: SPEC-2625 Signed-off-by: José Bollo <jose.bollo@iot.bzh> Change-Id: I45877583dbf478a79d405c3650880a5579ac1f9e
Diffstat (limited to 'src/afb-export.c')
-rw-r--r--src/afb-export.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/afb-export.c b/src/afb-export.c
index de6134d3..c146f7e8 100644
--- a/src/afb-export.c
+++ b/src/afb-export.c
@@ -1183,7 +1183,7 @@ static void listener_of_pushed_events(void *closure, const char *event, int even
listener_of_events(closure, event, eventid, object);
}
-static void listener_of_broadcasted_events(void *closure, const char *event, struct json_object *object)
+static void listener_of_broadcasted_events(void *closure, const char *event, struct json_object *object, const uuid_binary_t uuid, uint8_t hop)
{
listener_of_events(closure, event, 0, object);
}