]> Sergey Matveev's repositories - btrtrc.git/commitdiff
dht: BEP43
authorMatt Joiner <anacrolix@gmail.com>
Mon, 17 Aug 2015 16:09:10 +0000 (02:09 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 17 Aug 2015 16:09:10 +0000 (02:09 +1000)
dht/dht.go

index 0b99d4ce76fb7f9bc0870f4cb0ac08365deb40f5..ed45395ca0d57648f7753e3fa999d11a8c4641eb 100644 (file)
@@ -904,6 +904,11 @@ func (s *Server) query(node dHTAddr, q string, a map[string]interface{}, onRespo
                "q": q,
                "a": a,
        }
+       // BEP 43. Outgoing queries from uncontactiable nodes should contain
+       // "ro":1 in the top level dictionary.
+       if s.config.Passive {
+               d["ro"] = 1
+       }
        b, err := bencode.Marshal(d)
        if err != nil {
                return