Skip to content

Commit a74a534

Browse files
committed
Fix RemoteChild::wait_with_output: Drop self after stdout/stderr is fully read
Signed-off-by: Jiahao XU <[email protected]>
1 parent a30e59d commit a74a534

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/child.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,12 @@ impl<'s> RemoteChild<'s> {
169169

170170
// Execute them concurrently to avoid the pipe buffer being filled up
171171
// and cause the remote process to block forever.
172-
let (status, stdout, stderr) = try_join!(self.wait(), stdout_read, stderr_read)?;
172+
let (stdout, stderr) = try_join!(stdout_read, stderr_read)?;
173173
Ok(Output {
174-
status,
174+
// Once self.wait().await is done, the connection to the multiplex
175+
// server would also be dropped and the server would stop
176+
// sending data to stdout/stderr.
177+
status: self.wait().await?,
175178
stdout,
176179
stderr,
177180
})

0 commit comments

Comments
 (0)