Skip to content

Commit

Permalink
avoid storing localAddr
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Jan 10, 2025
1 parent d8cc67d commit cee8044
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion p2p/transport/quicreuse/connmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ func (c *ConnManager) transportForListen(association any, network string, laddr
}
return &singleOwnerTransport{
packetConn: conn,
localAddr: conn.LocalAddr(),
Transport: &wrappedQUICTransport{
&quic.Transport{
Conn: conn,
Expand Down
4 changes: 1 addition & 3 deletions p2p/transport/quicreuse/reuse.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ type refCountedQuicTransport interface {
type singleOwnerTransport struct {
Transport QUICTransport

localAddr net.Addr

// Used to write packets directly around QUIC.
packetConn net.PacketConn
}
Expand All @@ -44,7 +42,7 @@ var _ QUICTransport = &singleOwnerTransport{}
func (c *singleOwnerTransport) IncreaseCount() {}
func (c *singleOwnerTransport) DecreaseCount() { c.Transport.Close() }
func (c *singleOwnerTransport) LocalAddr() net.Addr {
return c.localAddr
return c.packetConn.LocalAddr()
}

func (c *singleOwnerTransport) Dial(ctx context.Context, addr net.Addr, tlsConf *tls.Config, conf *quic.Config) (quic.Connection, error) {
Expand Down

0 comments on commit cee8044

Please sign in to comment.