fix attach

Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
Victor Vieux 2014-12-23 02:16:10 +00:00
parent 2365ec79e6
commit 174f664b3f
1 changed files with 6 additions and 0 deletions

View File

@ -259,11 +259,17 @@ func proxyHijack(c *context, w http.ResponseWriter, r *http.Request) {
errc := make(chan error, 2)
cp := func(dst io.Writer, src io.Reader) {
_, err := io.Copy(dst, src)
if conn, ok := dst.(interface {
CloseWrite() error
}); ok {
conn.CloseWrite()
}
errc <- err
}
go cp(d, nc)
go cp(nc, d)
<-errc
<-errc
}
}