diff options
author | Simon Kelley <simon@thekelleys.org.uk> | 2021-08-12 17:00:10 +0100 |
---|---|---|
committer | Simon Kelley <simon@thekelleys.org.uk> | 2021-08-12 17:00:10 +0100 |
commit | 9afcb7ae6199018a05d8fddbedb89341855a5b4c (patch) | |
tree | 3dbe301eace2d582912c9ceaf8bf12b96f5d2f34 | |
parent | 545c4955e6cba50d284c3ef98f1ee17c1366a9b4 (diff) | |
download | dnsmasq-9afcb7ae6199018a05d8fddbedb89341855a5b4c.tar.gz |
Revert "There was a `notify` variable to keep track whether a subscriber is"
This reverts commit ea43234c868e4136d900f35a19aaedcfd9f96c70.
-rw-r--r-- | src/ubus.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -21,6 +21,7 @@ #include <libubus.h> static struct blob_buf b; +static int notify; static int error_logged = 0; static int ubus_handle_metrics(struct ubus_context *ctx, struct ubus_object *obj, @@ -77,6 +78,7 @@ static void ubus_subscribe_cb(struct ubus_context *ctx, struct ubus_object *obj) (void)ctx; my_syslog(LOG_DEBUG, _("UBus subscription callback: %s subscriber(s)"), obj->has_subscribers ? "1" : "0"); + notify = obj->has_subscribers; } static void ubus_destroy(struct ubus_context *ubus) @@ -310,7 +312,7 @@ void ubus_event_bcast(const char *type, const char *mac, const char *ip, const c struct ubus_context *ubus = (struct ubus_context *)daemon->ubus; int ret; - if (!ubus || !ubus_object.has_subscribers) + if (!ubus || !notify) return; blob_buf_init(&b, BLOBMSG_TYPE_TABLE); @@ -334,7 +336,7 @@ void ubus_event_bcast_connmark_allowlist_refused(u32 mark, const char *name) struct ubus_context *ubus = (struct ubus_context *)daemon->ubus; int ret; - if (!ubus || !ubus_object.has_subscribers) + if (!ubus || !notify) return; blob_buf_init(&b, 0); @@ -351,7 +353,7 @@ void ubus_event_bcast_connmark_allowlist_resolved(u32 mark, const char *name, co struct ubus_context *ubus = (struct ubus_context *)daemon->ubus; int ret; - if (!ubus || !ubus_object.has_subscribers) + if (!ubus || !notify) return; blob_buf_init(&b, 0); |