From 3be68ae552750c7ccbfabb6fbfdaf6c0debe3a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Papp?= Date: Fri, 6 Dec 2024 12:22:06 +0100 Subject: [PATCH] Remove unused variable --- relay/client/dialer/quic/conn.go | 17 ++++++----------- relay/client/dialer/quic/quic.go | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/relay/client/dialer/quic/conn.go b/relay/client/dialer/quic/conn.go index 179f3e9e9..e7d49a48b 100644 --- a/relay/client/dialer/quic/conn.go +++ b/relay/client/dialer/quic/conn.go @@ -27,16 +27,14 @@ func (a Addr) String() string { } type Conn struct { - session quic.Connection - remoteAddr Addr - ctx context.Context + session quic.Connection + ctx context.Context } -func NewConn(session quic.Connection, serverAddress string) net.Conn { +func NewConn(session quic.Connection) net.Conn { return &Conn{ - session: session, - remoteAddr: Addr{addr: serverAddress}, - ctx: context.Background(), + session: session, + ctx: context.Background(), } } @@ -61,10 +59,7 @@ func (c *Conn) Write(b []byte) (int, error) { } func (c *Conn) RemoteAddr() net.Addr { - if c.session != nil { - return c.session.RemoteAddr() - } - return c.remoteAddr + return c.session.RemoteAddr() } func (c *Conn) LocalAddr() net.Addr { diff --git a/relay/client/dialer/quic/quic.go b/relay/client/dialer/quic/quic.go index 92c824d46..c59b19a7b 100644 --- a/relay/client/dialer/quic/quic.go +++ b/relay/client/dialer/quic/quic.go @@ -55,7 +55,7 @@ func (d Dialer) Dial(ctx context.Context, address string) (net.Conn, error) { return nil, err } - conn := NewConn(session, address) + conn := NewConn(session) return conn, nil }