}
cl := t.cl
cl.AddDhtNodes(spec.DhtNodes)
+ t.UseSources(spec.Sources)
cl.lock()
defer cl.unlock()
t.initialPieceCheckDisabled = spec.DisableInitialPieceCheck
- t.useSources(spec.Sources)
for _, url := range spec.Webseeds {
t.addWebSeed(url)
}
"github.com/anacrolix/torrent/metainfo"
)
-func (t *Torrent) useSources(sources []string) {
+// Add HTTP endpoints that serve the metainfo. They will be used if the torrent info isn't obtained
+// yet. The Client HTTP client is used.
+func (t *Torrent) UseSources(sources []string) {
select {
case <-t.Closed():
return