mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-06 21:51:33 +00:00
Return listenbuffer behavior
Now we're start to serve early, but all Accept calls are intercepted by listenbuffer or systemd socket. Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
@@ -76,11 +76,10 @@ func (s *Server) Close() {
|
||||
}
|
||||
|
||||
// ServeAPI loops through all initialized servers and spawns goroutine
|
||||
// with Server method for each. It sets CreateMux() as Handler also.
|
||||
// with Serve() method for each.
|
||||
func (s *Server) ServeAPI() error {
|
||||
var chErrors = make(chan error, len(s.servers))
|
||||
for _, srv := range s.servers {
|
||||
srv.srv.Handler = s.CreateMux()
|
||||
go func(srv *HTTPServer) {
|
||||
var err error
|
||||
logrus.Infof("API listen on %s", srv.l.Addr())
|
||||
@@ -162,9 +161,13 @@ func (s *Server) makeHTTPHandler(handler httputils.APIFunc) http.HandlerFunc {
|
||||
}
|
||||
|
||||
// InitRouters initializes a list of routers for the server.
|
||||
// Sets those routers as Handler for each server.
|
||||
func (s *Server) InitRouters(d *daemon.Daemon) {
|
||||
s.addRouter(local.NewRouter(d))
|
||||
s.addRouter(network.NewRouter(d))
|
||||
for _, srv := range s.servers {
|
||||
srv.srv.Handler = s.CreateMux()
|
||||
}
|
||||
}
|
||||
|
||||
// addRouter adds a new router to the server.
|
||||
|
||||
Reference in New Issue
Block a user