diff --git a/router/connection.go b/router/connection.go index 2d9e0fe1..d07d2548 100644 --- a/router/connection.go +++ b/router/connection.go @@ -84,13 +84,13 @@ func (conn *RemoteConnection) RemoteTCPAddr() string { return conn.remoteTCPAddr } -func (conn *RemoteConnection) Shutdown(error) { -} - func (conn *RemoteConnection) Established() bool { return true } +func (conn *RemoteConnection) Shutdown(error) { +} + func (conn *RemoteConnection) String() string { from := "" if conn.local != nil { @@ -125,7 +125,7 @@ func (conn *LocalConnection) Start(acceptNewPeer bool) { } func (conn *LocalConnection) BreakTie(dupConn *LocalConnection) ConnectionTieBreak { - // conn.uid is used as the tie breaker here, in the knowledge that + // conn.uid is used as the tie breaker here, in the knowledge that // both sides will make the same decision. if conn.uid < dupConn.uid { return TieBreakWon @@ -136,12 +136,6 @@ func (conn *LocalConnection) BreakTie(dupConn *LocalConnection) ConnectionTieBre } } -func (conn *LocalConnection) Established() bool { - conn.RLock() - defer conn.RUnlock() - return conn.established -} - // Read by the forwarder processes when in the UDP senders func (conn *LocalConnection) RemoteUDPAddr() *net.UDPAddr { conn.RLock() @@ -149,6 +143,12 @@ func (conn *LocalConnection) RemoteUDPAddr() *net.UDPAddr { return conn.remoteUDPAddr } +func (conn *LocalConnection) Established() bool { + conn.RLock() + defer conn.RUnlock() + return conn.established +} + // Called by the forwarder processes in a few places (including // crypto), but the connection TCP receiver process, and by the local // peer actor process. Do not call this from the connection's actor