1
0
mirror of https://github.com/docker/cli.git synced 2026-01-16 20:22:36 +03:00

Flush whether or not there we set the rawmode to avoid the client to lock

Upstream-commit: cb54e9c659c681fde5311aacefe0e5ea8c564e17
Component: engine
This commit is contained in:
Guillaume J. Charmes
2013-04-09 09:59:30 -07:00
parent 7c684984e1
commit 00965e0e9e
2 changed files with 6 additions and 5 deletions

View File

@@ -803,9 +803,9 @@ func (srv *Server) CmdAttach(stdin io.ReadCloser, stdout rcli.DockerConn, args .
if container.Config.Tty {
stdout.SetOptionRawTerminal()
// Flush the options to make sure the client sets the raw mode
stdout.Write([]byte{})
}
// Flush the options to make sure the client sets the raw mode
stdout.Flush()
return <-container.Attach(stdin, nil, stdout, stdout)
}
@@ -893,9 +893,10 @@ func (srv *Server) CmdRun(stdin io.ReadCloser, stdout rcli.DockerConn, args ...s
if config.Tty {
stdout.SetOptionRawTerminal()
// Flush the options to make sure the client sets the raw mode
stdout.Flush()
}
// Flush the options to make sure the client sets the raw mode
// or tell the client there is no options
stdout.Flush()
// Create new container
container, err := srv.runtime.Create(config)

View File

@@ -93,7 +93,7 @@ func (c *DockerTCPConn) Write(b []byte) (int, error) {
}
func (c *DockerTCPConn) Flush() error {
_, err := c.conn.Write([]byte{})
_, err := c.Write([]byte{})
return err
}