]> Cypherpunks repositories - gostls13.git/commitdiff
undo CL 5436056 / 03560deae933
authorDave Cheney <dave@cheney.net>
Wed, 30 Nov 2011 22:14:03 +0000 (17:14 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 30 Nov 2011 22:14:03 +0000 (17:14 -0500)
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

src/pkg/exp/ssh/server.go

index 11d77235c6190989efd7675c388f04a3d1a336c7..428a747e1e0c89b424d0349d5f6ccde744d2c503 100644 (file)
@@ -636,15 +636,15 @@ func (s *ServerConn) Accept() (Channel, error) {
 
 // A Listener implements a network listener (net.Listener) for SSH connections.
 type Listener struct {
-       net.Listener
-       config *ServerConfig
+       listener net.Listener
+       config   *ServerConfig
 }
 
 // Accept waits for and returns the next incoming SSH connection.
 // The receiver should call Handshake() in another goroutine 
 // to avoid blocking the accepter.
 func (l *Listener) Accept() (*ServerConn, error) {
-       c, err := l.Listener.Accept()
+       c, err := l.listener.Accept()
        if err != nil {
                return nil, err
        }
@@ -652,6 +652,16 @@ func (l *Listener) Accept() (*ServerConn, error) {
        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
 // the given network address using net.Listen.
 func Listen(network, addr string, config *ServerConfig) (*Listener, error) {