]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
cache.get(): disable again, for now
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 6 Aug 2018 16:21:48 +0000 (18:21 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 17 Aug 2018 13:58:47 +0000 (15:58 +0200)
We need to think about the API carefully.

NEWS
daemon/README.rst
daemon/bindings.c

diff --git a/NEWS b/NEWS
index a4034a166c43b885da69f35cf8b13cdb3038118c..48d2304dc7d370c831ae18e8cea50609f3fb13c7 100644 (file)
--- 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)
 ================================
index 002e3375a5f0208508e9d2a7eec2837285a1b01d..9da1df316d89460ad12b8346b9ee8cb8a93c5f06 100644 (file)
@@ -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:**
index 3f49e2087569247bd92869bb28729a46b4c95d22..313b2bb268e561e266d07fc3295fada7d5be3fa3 100644 (file)
@@ -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