From 2fa5b810b94b6834619d1d8b98a28a33336ae32d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 6 Jan 2025 16:24:17 +0100 Subject: [PATCH] defer nits Swapping the fields reduces the size of the struct. (I see no reason for the previous field order.) --- daemon/defer.h | 2 +- python/knot_resolver/datamodel/templates/policy-config.lua.j2 | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/daemon/defer.h b/daemon/defer.h index c5ae26c50..18adf91b3 100644 --- a/daemon/defer.h +++ b/daemon/defer.h @@ -22,8 +22,8 @@ void defer_charge(uint64_t nsec, union kr_sockaddr *addr, bool stream); typedef struct { bool is_accounting; /// whether currently accounting the time to someone - union kr_sockaddr addr; /// request source (to which we account) or AF_UNSPEC if unknown yet bool stream; + union kr_sockaddr addr; /// request source (to which we account) or AF_UNSPEC if unknown yet uint64_t stamp; /// monotonic nanoseconds, probably won't wrap } defer_sample_state_t; extern defer_sample_state_t defer_sample_state; diff --git a/python/knot_resolver/datamodel/templates/policy-config.lua.j2 b/python/knot_resolver/datamodel/templates/policy-config.lua.j2 index 89eeb94c3..9d88537a9 100644 --- a/python/knot_resolver/datamodel/templates/policy-config.lua.j2 +++ b/python/knot_resolver/datamodel/templates/policy-config.lua.j2 @@ -36,6 +36,7 @@ cache.open({{ cfg.cache.size_max.bytes() }}, 'lmdb://{{ cfg.cache.storage }}') {% include "forward.lua.j2" %} -- DEFER section ------------------------------------ +-- Force-disable defer to avoid the default defer config. {% set disable_defer = true %} {% include "defer.lua.j2" %} -- 2.47.2