mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Windows: Refix server_windows to match linux
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
parent
04c6f09fbd
commit
2b7569ccc3
1 changed files with 17 additions and 11 deletions
|
@ -11,28 +11,34 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewServer sets up the required Server and does protocol specific checking.
|
// 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 (
|
var (
|
||||||
err error
|
ls []net.Listener
|
||||||
l net.Listener
|
|
||||||
)
|
)
|
||||||
switch proto {
|
switch proto {
|
||||||
case "tcp":
|
case "tcp":
|
||||||
l, err = s.initTcpSocket(addr)
|
l, err := s.initTcpSocket(addr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
ls = append(ls, l)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return nil, errors.New("Invalid protocol format. Windows only supports tcp.")
|
return nil, errors.New("Invalid protocol format. Windows only supports tcp.")
|
||||||
}
|
}
|
||||||
return &HttpServer{
|
|
||||||
&http.Server{
|
var res []serverCloser
|
||||||
Addr: addr,
|
for _, l := range ls {
|
||||||
Handler: s.router,
|
res = append(res, &HttpServer{
|
||||||
},
|
&http.Server{
|
||||||
l,
|
Addr: addr,
|
||||||
}, nil
|
Handler: s.router,
|
||||||
|
},
|
||||||
|
l,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return res, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) AcceptConnections(d *daemon.Daemon) {
|
func (s *Server) AcceptConnections(d *daemon.Daemon) {
|
||||||
|
|
Loading…
Reference in a new issue