diff --git a/dnscrypt-proxy/plugin_forward.go b/dnscrypt-proxy/plugin_forward.go index 7e1904b3..d93dd525 100644 --- a/dnscrypt-proxy/plugin_forward.go +++ b/dnscrypt-proxy/plugin_forward.go @@ -93,7 +93,7 @@ func (plugin *PluginForward) Eval(pluginsState *PluginsState, msg *dns.Msg) erro } server := servers[rand.Intn(len(servers))] pluginsState.serverName = server - client := dns.Client{Net: pluginsState.serverProto} + client := dns.Client{Net: pluginsState.serverProto, Timeout: pluginsState.timeout} respMsg, _, err := client.Exchange(msg, server) if err != nil { return err diff --git a/dnscrypt-proxy/plugins.go b/dnscrypt-proxy/plugins.go index 60a65dd8..c6245c9d 100644 --- a/dnscrypt-proxy/plugins.go +++ b/dnscrypt-proxy/plugins.go @@ -87,6 +87,7 @@ type PluginsState struct { returnCode PluginsReturnCode serverName string serverProto string + timeout time.Duration } func (proxy *Proxy) InitPluginsGlobals() error { @@ -240,6 +241,7 @@ func NewPluginsState(proxy *Proxy, clientProto string, clientAddr *net.Addr, ser qName: "", serverName: "-", serverProto: serverProto, + timeout: proxy.timeout, requestStart: start, maxUnencryptedUDPSafePayloadSize: MaxDNSUDPSafePacketSize, sessionData: make(map[string]interface{}),