Skip to content

Dispose streams when exec channel is closed instead of flushing #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

hifi
Copy link
Contributor

@hifi hifi commented Dec 27, 2016

Flushing PipeStream when the other end has been closed causes a deadlock and it doesn't make much sense given the closed state.

This commit allows streaming execs to successfully end after closing the output stream on client side.

Simple test case that should not fail when streams are closed on client side:

var ssh = new SshClient(...);
ssh.Connect();
var cmd = ssh.CreateCommand("cat");
var async = cmd.BeginExecute("test", null, null);
cmd.OutputStream.Close();
cmd.ExtendedOutputStream.Close();
cmd.EndExecute(async); // will hang
ssh.Disconnect();

Flushing PipeStream when the other end has been closed causes a
deadlock and it doesn't make much sense given the closed state.
@hifi
Copy link
Contributor Author

hifi commented Dec 28, 2016

Closing in favor of #144.

@hifi hifi closed this Dec 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant