mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-14 19:00:50 +01:00
Remove unused variable
This commit is contained in:
parent
e69b8f5788
commit
3be68ae552
@ -27,16 +27,14 @@ func (a Addr) String() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Conn struct {
|
type Conn struct {
|
||||||
session quic.Connection
|
session quic.Connection
|
||||||
remoteAddr Addr
|
ctx context.Context
|
||||||
ctx context.Context
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewConn(session quic.Connection, serverAddress string) net.Conn {
|
func NewConn(session quic.Connection) net.Conn {
|
||||||
return &Conn{
|
return &Conn{
|
||||||
session: session,
|
session: session,
|
||||||
remoteAddr: Addr{addr: serverAddress},
|
ctx: context.Background(),
|
||||||
ctx: context.Background(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,10 +59,7 @@ func (c *Conn) Write(b []byte) (int, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Conn) RemoteAddr() net.Addr {
|
func (c *Conn) RemoteAddr() net.Addr {
|
||||||
if c.session != nil {
|
return c.session.RemoteAddr()
|
||||||
return c.session.RemoteAddr()
|
|
||||||
}
|
|
||||||
return c.remoteAddr
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Conn) LocalAddr() net.Addr {
|
func (c *Conn) LocalAddr() net.Addr {
|
||||||
|
@ -55,7 +55,7 @@ func (d Dialer) Dial(ctx context.Context, address string) (net.Conn, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
conn := NewConn(session, address)
|
conn := NewConn(session)
|
||||||
return conn, nil
|
return conn, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user