]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
modules: fixed kmemcached after api change
authorMarek Vavruša <marek.vavrusa@nic.cz>
Fri, 29 May 2015 16:24:34 +0000 (18:24 +0200)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Fri, 29 May 2015 16:24:34 +0000 (18:24 +0200)
daemon/bindings.c
modules/kmemcached/kmemcached.c

index 3c936f6055cedc463c5ed13ea5c69a5ffc09c013..b20e3a0d686c4ce6a8443a7f71cc25b0fabaf518 100644 (file)
@@ -299,7 +299,7 @@ static int cache_backends(lua_State *L)
        lua_newtable(L);
        for (unsigned i = 0; i < registry->len; ++i) {
                struct storage_api *storage = &registry->at[i];
-               lua_pushboolean(L, storage->api() == engine->resolver.cache.api); /* kr_cache_storage()); */
+               lua_pushboolean(L, storage->api() == engine->resolver.cache.api);
                lua_setfield(L, -2, storage->prefix);
        }
        return 1;
@@ -309,7 +309,7 @@ static int cache_backends(lua_State *L)
 static int cache_count(lua_State *L)
 {
        struct engine *engine = engine_luaget(L);
-       const namedb_api_t *storage = engine->resolver.cache.api; /* kr_cache_storage(); */
+       const namedb_api_t *storage = engine->resolver.cache.api;
 
        /* Fetch item count */
        struct kr_cache_txn txn;
@@ -390,7 +390,6 @@ static int cache_open(lua_State *L)
        kr_cache_close(&engine->resolver.cache);
 
        /* Reopen cache */
-       /* kr_cache_storage_set(storage->api); */
        void *storage_opts = storage->opts_create(conf, cache_size);
        int ret = kr_cache_open(&engine->resolver.cache, storage->api(), storage_opts, engine->pool);
        free(storage_opts);
index 1ef4461f78bc16cd1a71a4ffd99a8ea55947be13..094da5684bbd5f182e24665dbc09a368550f32ec 100644 (file)
@@ -44,7 +44,7 @@ int kmemcached_deinit(struct kr_module *module)
 {
        struct engine *engine = module->data;
        /* It was currently loaded, close cache */
-       if (kr_cache_storage == namedb_memcached_api) {
+       if (engine->resolver.cache.api == namedb_memcached_api()) {
                kr_cache_close(&engine->resolver.cache);
        }
        /* Prevent from loading it again */