summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimír Čunát <vladimir.cunat@nic.cz>2025-01-06 16:24:17 +0100
committerVladimír Čunát <vladimir.cunat@nic.cz>2025-01-13 16:40:04 +0100
commit2fa5b810b94b6834619d1d8b98a28a33336ae32d (patch)
tree5fd02025380b398ba27116eb7384c0dd0b370187
parentNEWS: add defer bullet (diff)
downloadknot-resolver-2fa5b810b94b6834619d1d8b98a28a33336ae32d.tar.xz
knot-resolver-2fa5b810b94b6834619d1d8b98a28a33336ae32d.zip
defer nits
Swapping the fields reduces the size of the struct. (I see no reason for the previous field order.)
-rw-r--r--daemon/defer.h2
-rw-r--r--python/knot_resolver/datamodel/templates/policy-config.lua.j21
2 files changed, 2 insertions, 1 deletions
diff --git a/daemon/defer.h b/daemon/defer.h
index c5ae26c5..18adf91b 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 89eeb94c..9d88537a 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" %}