]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib/cache: cleanup
authorMarek Vavruša <marek.vavrusa@nic.cz>
Wed, 24 Jun 2015 15:20:09 +0000 (17:20 +0200)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Wed, 24 Jun 2015 15:20:09 +0000 (17:20 +0200)
lib/layer/rrcache.c
modules/cachectl/cachectl.c

index 8af6e9b49f15cb4230dfaed9a42f379c85bd0960..f5684be71108f21a577f48a127299b6be1f020c2 100644 (file)
@@ -267,14 +267,6 @@ static int stash(knot_layer_t *ctx, knot_pkt_t *pkt)
                }
                /* Clear if full */
                if (ret == KNOT_ESPACE) {
-                       /*
-                        * Commit empty transaction to make freed pages reclaimable
-                        * (This increases the txnid)
-                        */
-                       if (kr_cache_txn_begin(cache, &txn, 0) == 0) {
-                               kr_cache_txn_commit(&txn);
-                       }
-                       /* Now drop the database */
                        if (kr_cache_txn_begin(cache, &txn, 0) == 0) {
                                ret = kr_cache_clear(&txn);
                                if (ret == 0) {
index 4e042da96e8a788ef28251abb35eb3e9c2a6083c..173e5c6ad86d7a3fb127ef85959631f45db3d806 100644 (file)
@@ -99,7 +99,8 @@ static char* prune(void *env, struct kr_module *module, const char *args)
 
        /* Commit and format result. */
        char *result = NULL;
-       if (kr_cache_txn_commit(&txn) != 0) {
+       ret = kr_cache_txn_commit(&txn);
+       if (ret != 0) {
                asprintf(&result, "{ \"pruned\": %d, \"error\": \"%s\" }", pruned, knot_strerror(ret));
        } else {
                asprintf(&result, "{ \"pruned\": %d }", pruned);