mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #1035 from dotcloud/fix_panic_cast
- Runtime: fix panic with unix socket
This commit is contained in:
commit
1a201d2433
1 changed files with 8 additions and 2 deletions
|
@ -1474,9 +1474,15 @@ func (cli *DockerCli) hijack(method, path string, setRawTerminal bool, in io.Rea
|
|||
if in != nil {
|
||||
io.Copy(rwc, in)
|
||||
}
|
||||
if err := rwc.(*net.TCPConn).CloseWrite(); err != nil {
|
||||
if tcpc, ok := rwc.(*net.TCPConn); ok {
|
||||
if err := tcpc.CloseWrite(); err != nil {
|
||||
utils.Debugf("Couldn't send EOF: %s\n", err)
|
||||
}
|
||||
} else if unixc, ok := rwc.(*net.UnixConn); ok {
|
||||
if err := unixc.CloseWrite(); err != nil {
|
||||
utils.Debugf("Couldn't send EOF: %s\n", err)
|
||||
}
|
||||
}
|
||||
// Discard errors due to pipe interruption
|
||||
return nil
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue