Skip to content

Why check for net.Error? #133

Open
Open
@aidansteele

Description

@aidansteele

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions