Skip to content

Commit 03d8feb

Browse files
authored
Merge pull request moby#3506 from aaronlehmann/sshforward-connection-close
Propagate sshforward send side connection close
2 parents c521afd + 8c978cf commit 03d8feb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

session/sshforward/copy.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ func Copy(ctx context.Context, conn io.ReadWriteCloser, stream Stream, closeStre
2323
if err := stream.RecvMsg(p); err != nil {
2424
if err == io.EOF {
2525
// indicates client performed CloseSend, but they may still be
26-
// reading data, so don't close conn yet
26+
// reading data
27+
if conn, ok := conn.(interface {
28+
CloseWrite() error
29+
}); ok {
30+
conn.CloseWrite()
31+
}
2732
return nil
2833
}
2934
conn.Close()

0 commit comments

Comments
 (0)