Skip to content

Commit

Permalink
conn printers
Browse files Browse the repository at this point in the history
  • Loading branch information
mh0lt committed Jul 3, 2024
1 parent e4fb54c commit 48fa1c9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ func (p *Peer) close(lock bool, lockTorrent bool) {
}
p.peerImpl.onClose(false)
if p.t != nil {
fmt.Println("CWAP-CLS")
p.t.decPeerPieceAvailability(p, false, false)
}
for _, f := range p.callbacks.PeerClosed {
Expand Down
1 change: 1 addition & 0 deletions peerconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ func (cn *PeerConn) peerSentHaveNone(lockTorrent bool) error {
defer cn.mu.Unlock()

if !cn.peerSentHaveAll {
fmt.Println("CWAP-PSHN")
cn.t.decPeerPieceAvailability(&cn.Peer, false, false)
}
cn._peerPieces.Clear()
Expand Down
2 changes: 1 addition & 1 deletion torrent.go
Original file line number Diff line number Diff line change
Expand Up @@ -1994,7 +1994,7 @@ func (t *Torrent) deletePeerConn(c *PeerConn, lock bool) (ret bool) {
}
_, ret = t.conns[c]
delete(t.conns, c)
fmt.Println("-CON", t.numActivePeers(false), c.String())
fmt.Println("-CONN", len(t.connsWithAllPieces), t.numActivePeers(false), c.String())
// Avoid adding a drop event more than once. Probably we should track whether we've generated
// the drop event against the PexConnState instead.
if ret {
Expand Down

0 comments on commit 48fa1c9

Please sign in to comment.