projects
/
btrtrc.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
89f024a
)
dht: BEP43
author
Matt Joiner <anacrolix@gmail.com>
Mon, 17 Aug 2015 16:09:10 +0000 (
02:09
+1000)
committer
Matt Joiner <anacrolix@gmail.com>
Mon, 17 Aug 2015 16:09:10 +0000 (
02:09
+1000)
dht/dht.go
patch
|
blob
|
history
diff --git
a/dht/dht.go
b/dht/dht.go
index 0b99d4ce76fb7f9bc0870f4cb0ac08365deb40f5..ed45395ca0d57648f7753e3fa999d11a8c4641eb 100644
(file)
--- a/
dht/dht.go
+++ b/
dht/dht.go
@@
-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