gliderlabs / gliderlabs/ssh

Why check for net.Error?

Open
#133 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Go
Stars
4.2k
Forks
509
PR merge metrics
No merged PRs in 30d

Description

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`:

https://github.com/gliderlabs/ssh/blob/59d6e4540dea33ecd8f90b12887906b7b081fbcd/conn.go#L20

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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.