Skip to content

Commit

Permalink
nit: rename
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Jan 10, 2025
1 parent dd1e987 commit 404c3a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions p2p/transport/quicreuse/connmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,17 @@ func (c *ConnManager) LendTransport(network string, tr QUICTransport, conn net.P
}

refCountedTr := &refcountedTransport{
QUICTransport: tr,
packetConn: conn,
doneSignal: make(chan struct{}),
QUICTransport: tr,
packetConn: conn,
borrowDoneSignal: make(chan struct{}),
}

var reuse *reuse
reuse, err := c.getReuse(network)
if err != nil {
return nil, err
}
return refCountedTr.doneSignal, reuse.AddTransport(refCountedTr, localAddr)
return refCountedTr.borrowDoneSignal, reuse.AddTransport(refCountedTr, localAddr)
}

func (c *ConnManager) ListenQUIC(addr ma.Multiaddr, tlsConf *tls.Config, allowWindowIncrease func(conn quic.Connection, delta uint64) bool) (Listener, error) {
Expand Down
6 changes: 3 additions & 3 deletions p2p/transport/quicreuse/reuse.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ type refcountedTransport struct {
// Only set for transports we are borrowing.
// If set, we will _never_ close the underlying transport. We only close this
// channel to signal to the owner that we are done with it.
doneSignal chan struct{}
borrowDoneSignal chan struct{}

assocations map[any]struct{}
}
Expand Down Expand Up @@ -127,8 +127,8 @@ func (c *refcountedTransport) IncreaseCount() {
}

func (c *refcountedTransport) Close() error {
if c.doneSignal != nil {
close(c.doneSignal)
if c.borrowDoneSignal != nil {
close(c.borrowDoneSignal)
return nil
}

Expand Down

0 comments on commit 404c3a5

Please sign in to comment.