]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
defer nits docs-develop-defe-x6j6qe/deployments/6023
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 6 Jan 2025 15:24:17 +0000 (16:24 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 13 Jan 2025 15:40:04 +0000 (16:40 +0100)
Swapping the fields reduces the size of the struct.
(I see no reason for the previous field order.)

daemon/defer.h
python/knot_resolver/datamodel/templates/policy-config.lua.j2

index c5ae26c5058e5b39919cca9d6751d3f338eb1ee5..18adf91b3ce12b66136251b30e20a3c93a5b5a70 100644 (file)
@@ -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;
index 89eeb94c3ff31580bc50b6f6ef69f3fd1345b2ef..9d88537a960d145cdf171adc6bf27a8763860236 100644 (file)
@@ -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" %}