]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fixup compile without cachedb.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 10 Apr 2024 09:33:52 +0000 (11:33 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 10 Apr 2024 09:33:52 +0000 (11:33 +0200)
daemon/worker.c
services/mesh.c
util/module.h

index 80f48f7f813eada26373bc7698352894319410fe..722180059242fee1be8741c71dfc4b0f46ecb448 100644 (file)
@@ -659,9 +659,12 @@ answer_from_cache(struct worker* worker, struct query_info* qinfo,
        if(rep->ttl < timenow) {
                /* Check if we need to serve expired now */
                if(worker->env.cfg->serve_expired &&
-                       !worker->env.cfg->serve_expired_client_timeout &&
-                       !(worker->env.cachedb_enabled &&
-                         worker->env.cfg->cachedb_check_when_serve_expired)) {
+                       !worker->env.cfg->serve_expired_client_timeout
+#ifdef USE_CACHEDB
+                       && !(worker->env.cachedb_enabled &&
+                         worker->env.cfg->cachedb_check_when_serve_expired)
+#endif
+                       ) {
                                if(worker->env.cfg->serve_expired_ttl &&
                                        rep->serve_expired_ttl < timenow)
                                        return 0;
index 5bbff299589e606b443b3858547258fe86a2a7a8..80d4a5aa5d82cdbe930e0e829421cf4ade8f6e00 100644 (file)
@@ -511,6 +511,7 @@ void mesh_new_client(struct mesh_area* mesh, struct query_info* qinfo,
                log_err("mesh_new_client: out of memory initializing serve expired");
                goto servfail_mem;
        }
+#ifdef USE_CACHEDB
        if(!timeout && mesh->env->cfg->serve_expired &&
                !mesh->env->cfg->serve_expired_client_timeout &&
                (mesh->env->cachedb_enabled &&
@@ -520,6 +521,7 @@ void mesh_new_client(struct mesh_area* mesh, struct query_info* qinfo,
                        goto servfail_mem;
                }
        }
+#endif
        /* update statistics */
        if(was_detached) {
                log_assert(mesh->num_detached_states > 0);
@@ -625,6 +627,7 @@ mesh_new_callback(struct mesh_area* mesh, struct query_info* qinfo,
                        mesh_state_delete(&s->s);
                return 0;
        }
+#ifdef USE_CACHEDB
        if(!timeout && mesh->env->cfg->serve_expired &&
                !mesh->env->cfg->serve_expired_client_timeout &&
                (mesh->env->cachedb_enabled &&
@@ -635,6 +638,7 @@ mesh_new_callback(struct mesh_area* mesh, struct query_info* qinfo,
                        return 0;
                }
        }
+#endif
        /* update statistics */
        if(was_detached) {
                log_assert(mesh->num_detached_states > 0);
index c84f2626f4f5319c41bc00a0d3e10c91fb300147..8913f65266d2c777d659fb2abddfb607b3cc9523 100644 (file)
@@ -537,8 +537,10 @@ struct module_env {
        /** EDNS client string information */
        struct edns_strings* edns_strings;
 
+#ifdef USE_CACHEDB
        /** the cachedb enabled value, copied and stored here. */
        int cachedb_enabled;
+#endif
        /* Make every mesh state unique, do not aggregate mesh states. */
        int unique_mesh;
 };