Move the DockerConn flush to its own function

Upstream-commit: c83393a541353ab34612d80cc6b9bb4e92c59597
Component: engine
This commit is contained in:
Guillaume J. Charmes
2013-04-05 20:08:31 -07:00
parent b2cdbb0f98
commit c8a8294b68
3 changed files with 9 additions and 1 deletions
+5
View File
@@ -92,6 +92,11 @@ func (c *DockerTCPConn) Write(b []byte) (int, error) {
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) CloseWrite() error { return c.conn.CloseWrite() }
+3
View File
@@ -29,6 +29,7 @@ type DockerConn interface {
CloseRead() error
GetOptions() *DockerConnOptions
SetOptionRawTerminal()
Flush() error
}
type DockerLocalConn struct {
@@ -56,6 +57,8 @@ func (c *DockerLocalConn) Close() error {
return c.writer.Close()
}
func (c *DockerLocalConn) Flush() error { return nil }
func (c *DockerLocalConn) CloseWrite() error { return nil }
func (c *DockerLocalConn) CloseRead() error { return nil }