From 4fd125c48e2cf9a59f12dbdb9b7dd0e729159ee6 Mon Sep 17 00:00:00 2001 From: YX Hao Date: Sat, 4 Oct 2025 09:06:15 +0800 Subject: [PATCH] Call `updateMonitoringMetrics` in `ApplyLoggingPlugins` Keep both results the same. --- dnscrypt-proxy/plugins.go | 4 ++++ dnscrypt-proxy/proxy.go | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dnscrypt-proxy/plugins.go b/dnscrypt-proxy/plugins.go index 09a118baad..8f867531ad 100644 --- a/dnscrypt-proxy/plugins.go +++ b/dnscrypt-proxy/plugins.go @@ -76,6 +76,7 @@ type PluginsState struct { synthResponse *dns.Msg questionMsg *dns.Msg xTransport *XTransport + proxy *Proxy sessionData map[string]interface{} action PluginsAction timeout time.Duration @@ -269,6 +270,7 @@ func NewPluginsState( maxUnencryptedUDPSafePayloadSize: MaxDNSUDPSafePacketSize, sessionData: make(map[string]interface{}), xTransport: proxy.xTransport, + proxy: proxy, } } @@ -403,5 +405,7 @@ func (pluginsState *PluginsState) ApplyLoggingPlugins(pluginsGlobals *PluginsGlo return err } } + // Update monitoring metrics + updateMonitoringMetrics(pluginsState.proxy, pluginsState) return nil } diff --git a/dnscrypt-proxy/proxy.go b/dnscrypt-proxy/proxy.go index d8f8ee634b..07f630e373 100644 --- a/dnscrypt-proxy/proxy.go +++ b/dnscrypt-proxy/proxy.go @@ -818,9 +818,6 @@ func (proxy *Proxy) processIncomingQuery( // Apply logging plugins pluginsState.ApplyLoggingPlugins(&proxy.pluginsGlobals) - // Update monitoring metrics - updateMonitoringMetrics(proxy, &pluginsState) - return response }