From a636091243ab4d7d0baf6078cc5b144a2ef99555 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 6 Aug 2018 18:21:48 +0200 Subject: [PATCH] cache.get(): disable again, for now We need to think about the API carefully. --- NEWS | 5 +---- daemon/README.rst | 4 ++++ daemon/bindings.c | 11 +++++++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index a4034a166..48d2304dc 100644 --- a/NEWS +++ b/NEWS @@ -30,7 +30,7 @@ Improvements - bring in performace improvements provided by libknot 2.7 - old name "Knot DNS Resolver" is replaced by unambiguous "Knot Resolver" to prevent confusion with "Knot DNS" authoritative server - +- lua: resurrect cache.clear('name') Knot Resolver 2.4.1 (2018-08-02) ================================ @@ -49,9 +49,6 @@ Bugfixes This fixes lower hit rate in NSEC3 zones (since 2.4.0). - minor TCP and TLS fixes (!623, !624, !626) -Improvements ------------- -- lua: resurrect cache.get('name') and cache.clear('name'), with caveats Knot Resolver 2.4.0 (2018-07-03) ================================ diff --git a/daemon/README.rst b/daemon/README.rst index 002e3375a..9da1df316 100644 --- a/daemon/README.rst +++ b/daemon/README.rst @@ -827,6 +827,10 @@ daemons or manipulated from other processes, making for example synchronised loa .. function:: cache.get([domain]) + This function is not implemented at this moment. + We plan to re-introduce it soon, probably with a slightly different API. + +.. :return: table of records in cache matching the prefix .. error:: **Caveats:** diff --git a/daemon/bindings.c b/daemon/bindings.c index 3f49e2087..313b2bb26 100644 --- a/daemon/bindings.c +++ b/daemon/bindings.c @@ -1075,6 +1075,7 @@ static int cache_close(lua_State *L) return 1; } +#if 0 /** @internal Prefix walk. */ static int cache_prefixed(struct kr_cache *cache, const char *prefix, bool exact_name, knot_db_val_t keyval[][2], int maxcount) @@ -1087,6 +1088,7 @@ static int cache_prefixed(struct kr_cache *cache, const char *prefix, bool exact /* Start prefix search */ return kr_cache_match(cache, buf, exact_name, keyval, maxcount); } +#endif /** Prune expired/invalid records. */ static int cache_prune(lua_State *L) @@ -1134,6 +1136,7 @@ static int cache_clear_everything(lua_State *L) return 1; } +#if 0 /** @internal Dump cache key into table on Lua stack. */ static void cache_dump(lua_State *L, knot_db_val_t keyval[]) { @@ -1192,6 +1195,14 @@ static int cache_get(lua_State *L) } return 1; } +#endif +static int cache_get(lua_State *L) +{ + int ret = kr_error(ENOSYS); + format_error(L, kr_strerror(ret)); + lua_error(L); + return ret; +} /** Set time interval for cleaning rtt cache. * Servers with score >= KR_NS_TIMEOUTED will be cleaned after -- 2.47.2