]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Quieten tracker announce logging
authorMatt Joiner <anacrolix@gmail.com>
Fri, 26 Dec 2014 06:17:49 +0000 (17:17 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Fri, 26 Dec 2014 06:17:49 +0000 (17:17 +1100)
client.go

index 470a5f97dbc4432de1ea9f430eb04fcafeecd08e..52dcc84197519823ee754e8820b7f3c2993ebcd0 100644 (file)
--- a/client.go
+++ b/client.go
@@ -1902,9 +1902,6 @@ func (cl *Client) announceTorrentTrackersFastStart(req *tracker.AnnounceRequest,
                        outstanding++
                        go func(tr tracker.Client) {
                                err := cl.announceTorrentSingleTracker(tr, req, t)
-                               if err != nil {
-                                       log.Printf("error announcing %q to %s: %s", t, tr, err)
-                               }
                                oks <- err == nil
                        }(tr)
                }
@@ -1941,11 +1938,12 @@ newAnnounce:
                req.Left = t.BytesLeft()
                trackers = t.Trackers
                cl.mu.RUnlock()
+               numTrackersTried := 0
                for _, tier := range trackers {
                        for trIndex, tr := range tier {
+                               numTrackersTried++
                                err := cl.announceTorrentSingleTracker(tr, &req, t)
                                if err != nil {
-                                       log.Printf("error announcing %s to %s: %s", t, tr, err)
                                        continue
                                }
                                // Float the successful announce to the top of the tier. If
@@ -1959,6 +1957,9 @@ newAnnounce:
                                continue newAnnounce
                        }
                }
+               if numTrackersTried != 0 {
+                       log.Printf("%s: all trackers failed", t)
+               }
                // TODO: Wait until trackers are added if there are none.
                time.Sleep(10 * time.Second)
        }