"github.com/anacrolix/torrent/mse"
pp "github.com/anacrolix/torrent/peer_protocol"
request_strategy "github.com/anacrolix/torrent/request-strategy"
- "github.com/anacrolix/torrent/typed-roaring"
+ typedRoaring "github.com/anacrolix/torrent/typed-roaring"
)
type (
peerChoking bool
peerRequests map[Request]*peerRequestState
PeerPrefersEncryption bool // as indicated by 'e' field in extension handshake
- PeerListenPort int
// The highest possible number of pieces the torrent could have based on
// communication with the peer. Generally only useful until we have the
// torrent info.
)
const (
+ PeerSourceUtHolepunch = "C"
PeerSourceTracker = "Tr"
PeerSourceIncoming = "I"
PeerSourceDhtGetPeers = "Hg" // Peers we found by searching a DHT.
if p.updateRequestsTimer != nil {
p.updateRequestsTimer.Stop()
}
+ for _, prs := range p.peerRequests {
+ prs.allocReservation.Drop()
+ }
p.peerImpl.onClose()
if p.t != nil {
p.t.decPeerPieceAvailability(p)
func (cn *Peer) postHandshakeStats(f func(*ConnStats)) {
t := cn.t
f(&t.stats)
- f(&t.cl.stats)
+ f(&t.cl.connStats)
}
// All ConnStats that include this connection. Some objects are not known