return
}
var (
- k peersKey
+ k PeersKey
p Peer
)
for k, p = range t.Peers {
t = &torrent{
InfoHash: ih,
chunkSize: defaultChunkSize,
- Peers: make(map[peersKey]Peer),
+ Peers: make(map[PeersKey]Peer),
closing: make(chan struct{}),
ceasingNetworking: make(chan struct{}),
DownloadAll()
Trackers() [][]tracker.Client
Files() (ret []File)
- Peers() map[peersKey]Peer
+ Peers() map[PeersKey]Peer
}
\ No newline at end of file
}
// Peers returns torrent's peers
-func (t Torrent) Peers() map[peersKey]Peer {
+func (t Torrent) Peers() map[PeersKey]Peer {
return t.torrent.Peers
}
\ No newline at end of file
return
}
-type peersKey struct {
+type PeersKey struct {
IPBytes string
Port int
}
// Reserve of peers to connect to. A peer can be both here and in the
// active connections if were told about the peer after connecting with
// them. That encourages us to reconnect to peers that are well known.
- Peers map[peersKey]Peer
+ Peers map[PeersKey]Peer
wantPeers sync.Cond
// BEP 12 Multitracker Metadata Extension. The tracker.Client instances
if len(t.Peers) >= torrentPeersHighWater {
return
}
- key := peersKey{string(p.IP), p.Port}
+ key := PeersKey{string(p.IP), p.Port}
if _, ok := t.Peers[key]; ok {
return
}