зеркало из https://github.com/microsoft/docker.git
Windows: Refix server_windows to match linux
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
Родитель
04c6f09fbd
Коммит
2b7569ccc3
|
@ -11,28 +11,34 @@ import (
|
|||
)
|
||||
|
||||
// NewServer sets up the required Server and does protocol specific checking.
|
||||
func (s *Server) newServer(proto, addr string) (serverCloser, error) {
|
||||
func (s *Server) newServer(proto, addr string) ([]serverCloser, error) {
|
||||
var (
|
||||
err error
|
||||
l net.Listener
|
||||
ls []net.Listener
|
||||
)
|
||||
switch proto {
|
||||
case "tcp":
|
||||
l, err = s.initTcpSocket(addr)
|
||||
l, err := s.initTcpSocket(addr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ls = append(ls, l)
|
||||
|
||||
default:
|
||||
return nil, errors.New("Invalid protocol format. Windows only supports tcp.")
|
||||
}
|
||||
return &HttpServer{
|
||||
&http.Server{
|
||||
Addr: addr,
|
||||
Handler: s.router,
|
||||
},
|
||||
l,
|
||||
}, nil
|
||||
|
||||
var res []serverCloser
|
||||
for _, l := range ls {
|
||||
res = append(res, &HttpServer{
|
||||
&http.Server{
|
||||
Addr: addr,
|
||||
Handler: s.router,
|
||||
},
|
||||
l,
|
||||
})
|
||||
}
|
||||
return res, nil
|
||||
|
||||
}
|
||||
|
||||
func (s *Server) AcceptConnections(d *daemon.Daemon) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче