mirror of
https://github.com/coredns/coredns.git
synced 2025-10-30 09:43:17 -04:00
Allow more than 1 address for transfer (#121)
No reason why not to allow more then one address: `transfer to 127.0.0.1 10.240.20.1`. Fix startup as well, as it turned out to be broken...
This commit is contained in:
@@ -163,17 +163,20 @@ func (s *Server) Serve(ln ListenerFile) error {
|
||||
// ListenAndServe starts the server with a new listener. It blocks until the server stops.
|
||||
func (s *Server) ListenAndServe() error {
|
||||
err := s.setup()
|
||||
defer close(s.startChan)
|
||||
// defer close(s.startChan) // Don't understand why defer wouldn't actually work in this method.
|
||||
if err != nil {
|
||||
close(s.startChan)
|
||||
return err
|
||||
}
|
||||
|
||||
l, err := net.Listen("tcp", s.Addr)
|
||||
if err != nil {
|
||||
close(s.startChan)
|
||||
return err
|
||||
}
|
||||
pc, err := net.ListenPacket("udp", s.Addr)
|
||||
if err != nil {
|
||||
close(s.startChan)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -187,6 +190,7 @@ func (s *Server) ListenAndServe() error {
|
||||
go func() {
|
||||
s.server[0].ActivateAndServe()
|
||||
}()
|
||||
close(s.startChan)
|
||||
return s.server[1].ActivateAndServe()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user