Merge pull request #13559 from LK4D4/fix_systemd_listen

Treat systemd listeners as all other
Upstream-commit: 1f22676fcb2c6f2bd1a1cbf6123587c4d4e917d0
Component: engine
This commit is contained in:
Jessie Frazelle
2015-05-28 14:15:34 -07:00
2 changed files with 30 additions and 37 deletions

View File

@ -96,15 +96,17 @@ func (s *Server) ServeApi(protoAddrs []string) error {
if err != nil {
return err
}
s.servers = append(s.servers, srv)
s.servers = append(s.servers, srv...)
go func(proto, addr string) {
logrus.Infof("Listening for HTTP on %s (%s)", proto, addr)
if err := srv.Serve(); err != nil && strings.Contains(err.Error(), "use of closed network connection") {
err = nil
}
chErrors <- err
}(protoAddrParts[0], protoAddrParts[1])
for _, s := range srv {
logrus.Infof("Listening for HTTP on %s (%s)", protoAddrParts[0], protoAddrParts[1])
go func(s serverCloser) {
if err := s.Serve(); err != nil && strings.Contains(err.Error(), "use of closed network connection") {
err = nil
}
chErrors <- err
}(s)
}
}
for i := 0; i < len(protoAddrs); i++ {