mirror of
https://github.com/docker/docs.git
synced 2026-03-27 22:38:54 +07:00
Fix interactive exec over TLS
The code no longer assumes a net.TCPConn underlying the HTTP connection in order to close attached streams. Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
This commit is contained in:
@@ -1136,15 +1136,19 @@ func postContainerExecStart(eng *engine.Engine, version version.Version, w http.
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if tcpc, ok := inStream.(*net.TCPConn); ok {
|
||||
tcpc.CloseWrite()
|
||||
if cw, ok := inStream.(interface {
|
||||
CloseWrite() error
|
||||
}); ok {
|
||||
cw.CloseWrite()
|
||||
} else {
|
||||
inStream.Close()
|
||||
}
|
||||
}()
|
||||
defer func() {
|
||||
if tcpc, ok := outStream.(*net.TCPConn); ok {
|
||||
tcpc.CloseWrite()
|
||||
if cw, ok := outStream.(interface {
|
||||
CloseWrite() error
|
||||
}); ok {
|
||||
cw.CloseWrite()
|
||||
} else if closer, ok := outStream.(io.Closer); ok {
|
||||
closer.Close()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user