]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Reduce noise about zero port peers
authorMatt Joiner <anacrolix@gmail.com>
Thu, 17 Sep 2015 02:39:51 +0000 (12:39 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 17 Sep 2015 02:39:51 +0000 (12:39 +1000)
TODO
client.go

diff --git a/TODO b/TODO
index e5516862e48308dde3bb1ac8c23a389b932a9a11..e512fed677d465c11da2a99b3930f887fdbb857c 100644 (file)
--- a/TODO
+++ b/TODO
@@ -9,3 +9,4 @@
  * data/blob: Deleting incomplete data triggers io.ErrUnexpectedEOF that isn't recovered from.
  * UL/DL rate-limiting.
  * Handle Torrent being dropped before GotInfo.
+ * Punish sources of bad peers? Some trackers, PEX, and DHT give port 0s, which seems lousy. The spec suggests maybe to not worry about it, but some sources are very persistent.
index 7cb58efe168bb65d07f5d648e8623bb26c9687df..3e1b7148266aa394d8a55a986e87f09a957480af 100644 (file)
--- a/client.go
+++ b/client.go
@@ -1657,10 +1657,6 @@ func (me *Client) connectionLoop(t *torrent, c *connection) error {
                                        me.mu.Lock()
                                        me.addPeers(t, func() (ret []Peer) {
                                                for i, cp := range pexMsg.Added {
-                                                       if cp.Port == 0 {
-                                                               log.Printf("peer gave zero port peer over PEX\n\t%s", c)
-                                                               continue
-                                                       }
                                                        p := Peer{
                                                                IP:     make([]byte, 4),
                                                                Port:   int(cp.Port),
@@ -1846,7 +1842,7 @@ func (me *Client) addPeers(t *torrent, peers []Peer) {
                        continue
                }
                if p.Port == 0 {
-                       log.Printf("got bad peer: %v", p)
+                       // The spec says to scrub these yourselves. Fine.
                        continue
                }
                t.addPeer(p)