Fix: dns hot reload no effect
This commit is contained in:
parent
e3c78f934e
commit
3a065853c4
1 changed files with 9 additions and 4 deletions
|
@ -34,13 +34,18 @@ func (s *Server) ServeDNS(w D.ResponseWriter, r *D.Msg) {
|
||||||
w.WriteMsg(msg)
|
w.WriteMsg(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Server) setReslover(r *Resolver) {
|
||||||
|
s.r = r
|
||||||
|
}
|
||||||
|
|
||||||
func ReCreateServer(addr string, resolver *Resolver) error {
|
func ReCreateServer(addr string, resolver *Resolver) error {
|
||||||
if server.Server != nil {
|
if addr == address {
|
||||||
server.Shutdown()
|
server.setReslover(resolver)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if addr == address {
|
if server.Server != nil {
|
||||||
return nil
|
server.Shutdown()
|
||||||
}
|
}
|
||||||
|
|
||||||
_, port, err := net.SplitHostPort(addr)
|
_, port, err := net.SplitHostPort(addr)
|
||||||
|
|
Loading…
Reference in a new issue