From f52a4cdbf0701b12416cf52a04a164f59f19a8a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Papp?= Date: Thu, 10 Sep 2026 03:06:58 +0200 Subject: [PATCH] [relay] Fix build: return the concrete conn from Client.OpenConn OpenConn now returns *Conn, but it still went through connContainer.netConn(), which widens to net.Conn. The helper had one caller and only existed to produce the interface value the signature no longer wants, so return container.conn directly and drop it. --- shared/relay/client/client.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/shared/relay/client/client.go b/shared/relay/client/client.go index 1f280db50..5933ad5fd 100644 --- a/shared/relay/client/client.go +++ b/shared/relay/client/client.go @@ -113,10 +113,6 @@ func newConnContainer(log *log.Entry, c *Client, peerID messages.PeerID, instanc return cc } -func (cc *connContainer) netConn() net.Conn { - return cc.conn -} - func (cc *connContainer) writeMsg(msg Msg) { cc.msgChanLock.Lock() defer cc.msgChanLock.Unlock() @@ -300,7 +296,7 @@ func (c *Client) Connect(ctx context.Context) error { return nil } -// OpenConn create a new net.Conn for the destination peer ID. In case if the connection is in progress +// OpenConn create a new Conn for the destination peer ID. In case if the connection is in progress // to the relay server, the function will block until the connection is established or timed out. Otherwise, // it will return immediately. // It block until the server confirm the peer is online. @@ -358,7 +354,7 @@ func (c *Client) OpenConn(ctx context.Context, dstPeerID string) (*Conn, error) c.mu.Unlock() c.log.Infof("remote peer is available: %s", peerID) - return container.netConn(), nil + return container.conn, nil } // ServerInstanceURL returns the address of the relay server. It could change after the close and reopen the connection.