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 b4d713a commit dd1e987
Showing 1 changed file with 1 addition and 3 deletions.
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 dd1e987

Please sign in to comment.