We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5777c1b commit 2e01d90Copy full SHA for 2e01d90
1 file changed
cli/command/container/hijack.go
@@ -48,6 +48,13 @@ func (h *hijackedIOStreamer) stream(ctx context.Context) error {
48
outputDone := h.beginOutputStream(restoreInput)
49
inputDone, detached := h.beginInputStream(restoreInput)
50
51
+ defer func() {
52
+ // Close the pipe after the outputStream had done.
53
+ if err := h.resp.CloseWrite(); err != nil {
54
+ logrus.Debugf("Couldn't send EOF: %s", err)
55
+ }
56
+ }()
57
+
58
select {
59
case err := <-outputDone:
60
return err
@@ -167,11 +174,6 @@ func (h *hijackedIOStreamer) beginInputStream(restoreInput func()) (doneC <-chan
167
174
logrus.Debugf("Error sendStdin: %s", err)
168
175
}
169
176
170
-
171
- if err := h.resp.CloseWrite(); err != nil {
172
- logrus.Debugf("Couldn't send EOF: %s", err)
173
- }
177
close(inputDone)
178
}()
179
0 commit comments