mirror of
https://github.com/golang/go
synced 2024-11-22 04:04:40 -07:00
undo CL 5436056 / 03560deae933
Remove the accidentally exported net.Listener ««« original CL description exp/ssh: remove unused forwarding methods in Server Listener R=agl, rsc CC=golang-dev https://golang.org/cl/5436056 »»» R=agl, rsc CC=golang-dev https://golang.org/cl/5437090
This commit is contained in:
parent
bf43161c00
commit
0e62c75b9d
@ -636,15 +636,15 @@ func (s *ServerConn) Accept() (Channel, error) {
|
|||||||
|
|
||||||
// A Listener implements a network listener (net.Listener) for SSH connections.
|
// A Listener implements a network listener (net.Listener) for SSH connections.
|
||||||
type Listener struct {
|
type Listener struct {
|
||||||
net.Listener
|
listener net.Listener
|
||||||
config *ServerConfig
|
config *ServerConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
// Accept waits for and returns the next incoming SSH connection.
|
// Accept waits for and returns the next incoming SSH connection.
|
||||||
// The receiver should call Handshake() in another goroutine
|
// The receiver should call Handshake() in another goroutine
|
||||||
// to avoid blocking the accepter.
|
// to avoid blocking the accepter.
|
||||||
func (l *Listener) Accept() (*ServerConn, error) {
|
func (l *Listener) Accept() (*ServerConn, error) {
|
||||||
c, err := l.Listener.Accept()
|
c, err := l.listener.Accept()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -652,6 +652,16 @@ func (l *Listener) Accept() (*ServerConn, error) {
|
|||||||
return conn, nil
|
return conn, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Addr returns the listener's network address.
|
||||||
|
func (l *Listener) Addr() net.Addr {
|
||||||
|
return l.listener.Addr()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close closes the listener.
|
||||||
|
func (l *Listener) Close() error {
|
||||||
|
return l.listener.Close()
|
||||||
|
}
|
||||||
|
|
||||||
// Listen creates an SSH listener accepting connections on
|
// Listen creates an SSH listener accepting connections on
|
||||||
// the given network address using net.Listen.
|
// the given network address using net.Listen.
|
||||||
func Listen(network, addr string, config *ServerConfig) (*Listener, error) {
|
func Listen(network, addr string, config *ServerConfig) (*Listener, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user