From: Matt Joiner Date: Thu, 24 Apr 2025 13:07:52 +0000 (+1000) Subject: Add a few TODOs and fixes to trackerScraper X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=932b462e3cd247680395e0473c16cdd141ace306;p=btrtrc.git Add a few TODOs and fixes to trackerScraper --- diff --git a/torrent.go b/torrent.go index f6d39523..280ae450 100644 --- a/torrent.go +++ b/torrent.go @@ -3002,6 +3002,7 @@ func (t *Torrent) pieceRequestIndexOffset(piece pieceIndex) RequestIndex { } func (t *Torrent) updateComplete() { + // TODO: Announce complete to trackers? t.complete.SetBool(t.haveAllPieces()) } diff --git a/tracker_scraper.go b/tracker_scraper.go index cc7ba423..399fa63f 100644 --- a/tracker_scraper.go +++ b/tracker_scraper.go @@ -25,6 +25,7 @@ type trackerScraper struct { lastAnnounce trackerAnnounceResult lookupTrackerIp func(*url.URL) ([]net.IP, error) + // TODO: chansync stopOnce sync.Once stopCh chan struct{} } @@ -36,7 +37,7 @@ type torrentTrackerAnnouncer interface { Stop() } -func (me trackerScraper) URL() *url.URL { +func (me *trackerScraper) URL() *url.URL { return &me.u } @@ -219,6 +220,7 @@ func (me *trackerScraper) Run() { ctx, cancel := context.WithCancel(context.Background()) defer cancel() + // TODO: Get rid of the need for this. go func() { defer cancel() select {