Commit 397d6787 authored by Aka.Why's avatar Aka.Why Committed by Matt Holt

caddy: Start all servers only after all listeners successful (#2508)

parent 47b78714
......@@ -781,6 +781,10 @@ func startServers(serverList []Server, inst *Instance, restartFds map[string]res
}
}
inst.servers = append(inst.servers, ServerListener{server: s, listener: ln, packet: pc})
}
for _, s := range inst.servers {
inst.wg.Add(2)
stopWg.Add(2)
func(s Server, ln net.Listener, pc net.PacketConn, inst *Instance) {
......@@ -799,9 +803,7 @@ func startServers(serverList []Server, inst *Instance, restartFds map[string]res
}()
errChan <- s.ServePacket(pc)
}()
}(s, ln, pc, inst)
inst.servers = append(inst.servers, ServerListener{server: s, listener: ln, packet: pc})
}(s.server, s.listener, s.packet, inst)
}
// Log errors that may be returned from Serve() calls,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment