Skip to content

Commit

Permalink
remove cons printers
Browse files Browse the repository at this point in the history
  • Loading branch information
mh0lt committed Jul 3, 2024
1 parent a69ba06 commit c3f9bb9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
5 changes: 0 additions & 5 deletions peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,6 @@ func (p *Peer) close(lockTorrent bool) {
defer p.t.mu.Unlock()
}

if p.t != nil {
fmt.Println("CWAP-CLS", len(p.t.connsWithAllPieces), p.t.numActivePeers(false), p.t.Name())
defer fmt.Println("CWAP-CLS-DONE", len(p.t.connsWithAllPieces), p.t.numActivePeers(false), p.t.Name())
}

p.mu.Lock()
defer p.mu.Unlock()

Expand Down
1 change: 0 additions & 1 deletion peerconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,6 @@ func (cn *PeerConn) peerSentHaveNone(lockTorrent bool) error {
defer cn.mu.Unlock()

if !cn.peerSentHaveAll {
fmt.Println("CWAP-PSHN", len(cn.t.connsWithAllPieces), cn.t.numActivePeers(false), cn.t.Name())
cn.t.decPeerPieceAvailability(&cn.Peer, false, false)
}
cn._peerPieces.Clear()
Expand Down
7 changes: 0 additions & 7 deletions torrent.go
Original file line number Diff line number Diff line change
Expand Up @@ -2002,7 +2002,6 @@ func (t *Torrent) deletePeerConn(c *PeerConn, lock bool) (ret bool) {
}
_, ret = t.conns[c]
delete(t.conns, c)
fmt.Println("-CWAP-CN", len(t.connsWithAllPieces), t.numActivePeers(false), t.Name(), 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 All @@ -2018,9 +2017,6 @@ func (t *Torrent) deletePeerConn(c *PeerConn, lock bool) (ret bool) {
c.deleteAllRequests("Torrent.deletePeerConn", false)
t.assertPendingRequests(false)
if t.numActivePeers(false) == 0 && len(t.connsWithAllPieces) != 0 {
for p := range t.connsWithAllPieces {
fmt.Println("CWAP", p.t.Name(), p.String())
}
panic(fmt.Sprintf("no active peers, but %d conns with all", len(t.connsWithAllPieces)))
}
return
Expand Down Expand Up @@ -2531,7 +2527,6 @@ func (t *Torrent) addPeerConn(c *PeerConn, lockTorrent bool) (err error) {
}

t.conns[c] = struct{}{}
fmt.Println("+CWAP-CN", len(t.connsWithAllPieces), t.numActivePeers(false), t.Name(), c.String())

t.cl.event.Broadcast()
// We'll never receive the "p" extended handshake parameter.
Expand Down Expand Up @@ -3470,7 +3465,6 @@ func (t *Torrent) addConnWithAllPieces(p *Peer, lock bool) {
t.connsWithAllPieces = make(map[*Peer]struct{}, t.maxEstablishedConns)
}
t.connsWithAllPieces[p] = struct{}{}
fmt.Println("+CWAP", len(t.connsWithAllPieces), t.numActivePeers(false), p.t.Name(), p.String())
}

func (t *Torrent) deleteConnWithAllPieces(p *Peer, lock bool) bool {
Expand All @@ -3481,7 +3475,6 @@ func (t *Torrent) deleteConnWithAllPieces(p *Peer, lock bool) bool {

_, ok := t.connsWithAllPieces[p]
delete(t.connsWithAllPieces, p)
fmt.Println("-CWAP", len(t.connsWithAllPieces), t.numActivePeers(false), p.t.Name(), p.String())
return ok
}

Expand Down

0 comments on commit c3f9bb9

Please sign in to comment.