Skip to content

Commit

Permalink
Use quic-go tranpsport.WriteTo
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Aug 11, 2023
1 parent e25fbc1 commit 06f42e5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions p2p/transport/quicreuse/reuse.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ func (c *singleOwnerTransport) Close() error {
}

func (c *singleOwnerTransport) WriteTo(b []byte, addr net.Addr) (int, error) {
// Safe because we called quic.OptimizeConn ourselves.
return c.packetConn.WriteTo(b, addr)
return c.Transport.WriteTo(b, addr)
}

// Constant. Defined as variables to simplify testing.
Expand Down Expand Up @@ -86,8 +85,7 @@ func (c *refcountedTransport) Close() error {
}

func (c *refcountedTransport) WriteTo(b []byte, addr net.Addr) (int, error) {
// Safe because we called quic.OptimizeConn ourselves.
return c.packetConn.WriteTo(b, addr)
return c.Transport.WriteTo(b, addr)
}

func (c *refcountedTransport) LocalAddr() net.Addr {
Expand Down

0 comments on commit 06f42e5

Please sign in to comment.