Keep holding the read lock in the cloaking load-balancing code

Maybe
fixes #807
This commit is contained in:
Frank Denis 2019-05-02 23:53:47 +02:00
parent 02d07df43f
commit 50a2018633
1 changed files with 2 additions and 2 deletions

View File

@ -151,8 +151,7 @@ func (plugin *PluginCloak) Eval(pluginsState *PluginsState, msg *dns.Msg) error
}
}
plugin.Unlock()
} else {
plugin.RUnlock()
plugin.RLock()
}
var ip *net.IP
if question.Qtype == dns.TypeA {
@ -166,6 +165,7 @@ func (plugin *PluginCloak) Eval(pluginsState *PluginsState, msg *dns.Msg) error
ip = &cloakedName.ipv6[rand.Intn(ipLen)]
}
}
plugin.RUnlock()
synth, err := EmptyResponseFromMessage(msg)
if err != nil {
return err