Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 9.6% on proxy.golang.org
Top 3.4% dependent packages on proxy.golang.org
Top 4.8% dependent repos on proxy.golang.org

proxy.golang.org : github.com/problame/go-netssh

Minimum Go Version We require Go 1.11 in order to support deadlines: This package uses two *os.File (stdin, stdout) to implement a net.Conn interface. As such, we need to support deadlines, and Go 1.10 introduced deadlines for certain types of *os.File (https://golang.org/doc/go1.10#os). However, apart from OS/FS constraints, deadlines on *os.File only work if the underlying FD can be added to Go's event pool mechanism, which generally requires the FD to be non-blocking at the time the *os.File is created. This is the case for os.Open and so on, but not for os.Std{in,out,err}, which are created using os.NewFile from the existing FDs 0, 1 and 2. Those are blocking by default, and Go does not change them to non-blocking because the parent process might be a terminal and not expect the tty to change to non-blocking mode after the Go process exits. Hence, in Go 1.10, deadline operations on os.Std{in,out,err} fail with os.ErrDeadline. Go 1.11 improves the behavior of os.NewFile such that iff the FD passed to os.NewFile is already non-blocking, the *os.File / FD is part of the event loop, which makes deadlines work iff the OS supports it at all (this is the case for stdin, stdout, stderr, which are pipes in our specific use case). See https://github.com/golang/go/issues/24842#issuecomment-381268558 How do we deal with this issue in package netssh? We require Go 1.11 via build tag to get the os.NewFile behavior described above and set os.Std{in,out} to non-blocking before sending it over the unix control socket. See usage of github.com/ftrvxmtrx/fd in functions Proxy and Listener.Accept.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/problame/go-netssh
Keywords: golang, network, openssh, ssh, transport
License: MIT
Latest release: over 3 years ago
First release: over 3 years ago
Namespace: github.com/problame
Dependent packages: 3
Dependent repositories: 1
Stars: 6 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 30 days ago

    Loading...
    Readme
    Loading...