Pārlūkot izejas kodu

Flush stdout on import to avoid deadklock when waiting for stdin (import -). Fixed #365

Guillaume J. Charmes 12 gadi atpakaļ
vecāks
revīzija
1eaaa6b744
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2 1
      commands.go

+ 2 - 1
commands.go

@@ -419,7 +419,8 @@ func (srv *Server) CmdKill(stdin io.ReadCloser, stdout io.Writer, args ...string
 	return nil
 	return nil
 }
 }
 
 
-func (srv *Server) CmdImport(stdin io.ReadCloser, stdout io.Writer, args ...string) error {
+func (srv *Server) CmdImport(stdin io.ReadCloser, stdout rcli.DockerConn, args ...string) error {
+	stdout.Flush()
 	cmd := rcli.Subcmd(stdout, "import", "[OPTIONS] URL|- [REPOSITORY [TAG]]", "Create a new filesystem image from the contents of a tarball")
 	cmd := rcli.Subcmd(stdout, "import", "[OPTIONS] URL|- [REPOSITORY [TAG]]", "Create a new filesystem image from the contents of a tarball")
 	var archive io.Reader
 	var archive io.Reader
 	var resp *http.Response
 	var resp *http.Response