mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #372 from srid/goroutine-scope
serve goroutine must refer to the local conn
This commit is contained in:
commit
f507188ddc
1 changed files with 3 additions and 3 deletions
|
@ -138,7 +138,8 @@ func ListenAndServe(proto, addr string, service Service) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
go func() {
|
||||
go func(conn DockerConn) {
|
||||
defer conn.Close()
|
||||
if DEBUG_FLAG {
|
||||
CLIENT_SOCKET = conn
|
||||
}
|
||||
|
@ -146,8 +147,7 @@ func ListenAndServe(proto, addr string, service Service) error {
|
|||
log.Println("Error:", err.Error())
|
||||
fmt.Fprintln(conn, "Error:", err.Error())
|
||||
}
|
||||
conn.Close()
|
||||
}()
|
||||
}(conn)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Add table
Reference in a new issue