From 1283a0f4414dd66c7ef0665ee60413d30f3ee2cc Mon Sep 17 00:00:00 2001
From: =?utf8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
Date: Fri, 10 Feb 2017 15:17:44 +0100
Subject: [PATCH] Rename cache scanning to updating
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

What we were do is querying over all interfaces for all cached entries.
This isn't real scanning but rather updating (the cache).

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: John Crispin <john@phrozen.org>
---
 cache.c | 2 +-
 cache.h | 2 +-
 ubus.c  | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/cache.c b/cache.c
index 6bf0d26..dd263d2 100644
--- a/cache.c
+++ b/cache.c
@@ -121,7 +121,7 @@ void cache_cleanup(struct interface *iface)
 }
 
 void
-cache_scan(void)
+cache_update(void)
 {
 	struct interface *iface;
 	struct cache_service *s;
diff --git a/cache.h b/cache.h
index d433fae..4b86a83 100644
--- a/cache.h
+++ b/cache.h
@@ -49,7 +49,7 @@ struct cache_record {
 extern struct avl_tree services;
 
 int cache_init(void);
-void cache_scan(void);
+void cache_update(void);
 void cache_cleanup(struct interface *iface);
 void cache_answer(struct interface *iface, uint8_t *base, int blen,
 		  char *name, struct dns_answer *a, uint8_t *rdata, int flush);
diff --git a/ubus.c b/ubus.c
index 9a16a86..69db2ac 100644
--- a/ubus.c
+++ b/ubus.c
@@ -39,11 +39,11 @@ umdns_reload(struct ubus_context *ctx, struct ubus_object *obj,
 }
 
 static int
-umdns_scan(struct ubus_context *ctx, struct ubus_object *obj,
+umdns_update(struct ubus_context *ctx, struct ubus_object *obj,
 		struct ubus_request_data *req, const char *method,
 		struct blob_attr *msg)
 {
-	cache_scan();
+	cache_update();
 	return 0;
 }
 
@@ -228,7 +228,7 @@ static const struct ubus_method umdns_methods[] = {
 	UBUS_METHOD("set_config", umdns_set_config, config_policy),
 	UBUS_METHOD("query", umdns_query, query_policy),
 	UBUS_METHOD("fetch", umdns_query, query_policy),
-	UBUS_METHOD_NOARG("scan", umdns_scan),
+	UBUS_METHOD_NOARG("update", umdns_update),
 	UBUS_METHOD_NOARG("browse", umdns_browse),
 	UBUS_METHOD_NOARG("hosts", umdns_hosts),
 	UBUS_METHOD_NOARG("reload", umdns_reload),
-- 
2.25.1