commit 483a23c0fbd9dbd54dbb963425f9673d2dfca347 Author: David Fifield david@bamsoftware.com Date: Tue Nov 26 22:42:44 2013 -0800
Have extOrPortSendUserAddr take an Addr, not a Conn. --- pt.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pt.go b/pt.go index 58a6824..1bbd911 100644 --- a/pt.go +++ b/pt.go @@ -604,8 +604,8 @@ func extOrPortSendCommand(s io.Writer, cmd uint16, body []byte) error {
// Send a USERADDR command on s. See section 3.1.2.1 of // 196-transport-control-ports.txt. -func extOrPortSendUserAddr(s io.Writer, conn net.Conn) error { - return extOrPortSendCommand(s, extOrCmdUserAddr, []byte(conn.RemoteAddr().String())) +func extOrPortSendUserAddr(s io.Writer, addr net.Addr) error { + return extOrPortSendCommand(s, extOrCmdUserAddr, []byte(addr.String())) }
// Send a TRANSPORT command on s. See section 3.1.2.2 of @@ -651,7 +651,7 @@ func extOrPortRecvCommand(s io.Reader) (cmd uint16, body []byte, err error) { func extOrPortSetup(s io.ReadWriter, conn net.Conn, methodName string) error { var err error
- err = extOrPortSendUserAddr(s, conn) + err = extOrPortSendUserAddr(s, conn.RemoteAddr()) if err != nil { return err }