mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-14 21:31:16 +08:00
Fix: dns hot reload no effect
This commit is contained in:
parent
bb267e4a1f
commit
14600a8170
@ -34,13 +34,18 @@ func (s *Server) ServeDNS(w D.ResponseWriter, r *D.Msg) {
|
||||
w.WriteMsg(msg)
|
||||
}
|
||||
|
||||
func (s *Server) setReslover(r *Resolver) {
|
||||
s.r = r
|
||||
}
|
||||
|
||||
func ReCreateServer(addr string, resolver *Resolver) error {
|
||||
if server.Server != nil {
|
||||
server.Shutdown()
|
||||
if addr == address {
|
||||
server.setReslover(resolver)
|
||||
return nil
|
||||
}
|
||||
|
||||
if addr == address {
|
||||
return nil
|
||||
if server.Server != nil {
|
||||
server.Shutdown()
|
||||
}
|
||||
|
||||
_, port, err := net.SplitHostPort(addr)
|
||||
|
Loading…
Reference in New Issue
Block a user