[bittorrent] DHT question: get_peers respond

arvid at cs.umu.se arvid at cs.umu.se
Mon May 7 13:39:52 EDT 2007


Quoting roee shlomo <roee88 at gmail.com>:

> Hi all,
> 
> When receiving get_peers request, in case I have peers in my local table the
> specs says:
> 
> > if the queried node has peers for the infohash, they are returned in a key
> > "values" as a list with a single string containing "compact" format peer
> > information concatenated together.
> >
> 
> So in case I have (i.e.) two peers how should I respond?
> 
> {"id" : "<queried nodes id>", "values" : ["<compact peer info string for
> both peers (string length of 12)>"]}
> 
> or:
> 
> {"id" : "<queried nodes id>", "values" : ["<compact peer1 info
> string>", "<compact
> peer2 info string>"]}
> 
> It seems like the first is the right one, but then I ask-  why a list?

uTorrent and libtorrent (and possibly other clients) implements this as a list
of strings (option 2). That way IPv6 addresses can be put in there too.
Mainline implements it as option 1 (afaik), but it doesn't use the DHT as much,
and is not as present. The reason for this confusion was that both uTorrent and
libtorrent implemented this before the draft document was released, and looked
at network captures.

-- 
Arvid Norberg



More information about the BitTorrent mailing list