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

Why check for net.Error? #133

Open
aidansteele opened this issue Feb 3, 2020 · 0 comments
Open

Why check for net.Error? #133

aidansteele opened this issue Feb 3, 2020 · 0 comments
Labels

Comments

@aidansteele
Copy link
Contributor

Love the library - it's brilliant. One question:

In (*serverConn).Read and (*serverConn).Write, there is the following line that only cancels the context if the error is a net.Error:

ssh/conn.go

Line 20 in 59d6e45

if _, isNetErr := err.(net.Error); isNetErr && c.closeCanceler != nil {

Why does it check for this type and not cancel the context for other types of errors? I am using github.com/hashicorp/yamux to provide the underlying net.Conn and it returns io.EOF when the stream is closed - which isn't a net.Error, so the context doesn't get cancelled and the connection just hangs around.

Am I perhaps misunderstanding some details? Or is this a bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants