Skip to content
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

Close ssh tunnel when either end closes the connection #2184

Merged
merged 1 commit into from
Sep 11, 2018

Conversation

Qining
Copy link
Contributor

@Qining Qining commented Sep 7, 2018

So that when users tracing through SSH with a specific number of frames to capture, the connection will be closed after that number of frames are captured.

break
}
}
writer.Close()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we not just continue using io.Copy() and just close the writer then that finishes?

@Qining Qining force-pushed the close-tunnel-either-side branch 2 times, most recently from dab8fc1 to e7bfac0 Compare September 7, 2018 18:43
@Qining
Copy link
Contributor Author

Qining commented Sep 7, 2018

@AWoloszyn You are right, the previous code is exactly the same to the io.Copy. This one check the error message to ignore the errors from normal exit.

So that when users tracing through SSH with a specific number of frames
to capture, the connection will be closed after that number of frames
are captured.
@Qining Qining merged commit 79d1e40 into google:master Sep 11, 2018
@Qining Qining deleted the close-tunnel-either-side branch October 23, 2018 17:32
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.

2 participants