Move the DockerConn flush to its own function
This commit is contained in:
parent
7e1e7d14fa
commit
c83393a541
|
@ -894,7 +894,7 @@ func (srv *Server) CmdRun(stdin io.ReadCloser, stdout rcli.DockerConn, args ...s
|
||||||
if config.Tty {
|
if config.Tty {
|
||||||
stdout.SetOptionRawTerminal()
|
stdout.SetOptionRawTerminal()
|
||||||
// Flush the options to make sure the client sets the raw mode
|
// Flush the options to make sure the client sets the raw mode
|
||||||
stdout.Write([]byte{})
|
stdout.Flush()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create new container
|
// Create new container
|
||||||
|
|
|
@ -92,6 +92,11 @@ func (c *DockerTCPConn) Write(b []byte) (int, error) {
|
||||||
return n + optionsLen, err
|
return n + optionsLen, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *DockerTCPConn) Flush() error {
|
||||||
|
_, err := c.conn.Write([]byte{})
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
func (c *DockerTCPConn) Close() error { return c.conn.Close() }
|
func (c *DockerTCPConn) Close() error { return c.conn.Close() }
|
||||||
|
|
||||||
func (c *DockerTCPConn) CloseWrite() error { return c.conn.CloseWrite() }
|
func (c *DockerTCPConn) CloseWrite() error { return c.conn.CloseWrite() }
|
||||||
|
|
|
@ -29,6 +29,7 @@ type DockerConn interface {
|
||||||
CloseRead() error
|
CloseRead() error
|
||||||
GetOptions() *DockerConnOptions
|
GetOptions() *DockerConnOptions
|
||||||
SetOptionRawTerminal()
|
SetOptionRawTerminal()
|
||||||
|
Flush() error
|
||||||
}
|
}
|
||||||
|
|
||||||
type DockerLocalConn struct {
|
type DockerLocalConn struct {
|
||||||
|
@ -56,6 +57,8 @@ func (c *DockerLocalConn) Close() error {
|
||||||
return c.writer.Close()
|
return c.writer.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *DockerLocalConn) Flush() error { return nil }
|
||||||
|
|
||||||
func (c *DockerLocalConn) CloseWrite() error { return nil }
|
func (c *DockerLocalConn) CloseWrite() error { return nil }
|
||||||
|
|
||||||
func (c *DockerLocalConn) CloseRead() error { return nil }
|
func (c *DockerLocalConn) CloseRead() error { return nil }
|
||||||
|
|
Loading…
Reference in New Issue