Merge pull request #282 from mrd0ll4r/udp-scrapes

udp: fix ordering of scrapes
This commit is contained in:
Jimmy Zelinskie
2017-01-31 20:17:01 -05:00
committed by GitHub
5 changed files with 10 additions and 5 deletions
+2 -2
View File
@@ -74,8 +74,8 @@ func WriteAnnounceResponse(w http.ResponseWriter, resp *bittorrent.AnnounceRespo
// client over HTTP.
func WriteScrapeResponse(w http.ResponseWriter, resp *bittorrent.ScrapeResponse) error {
filesDict := bencode.NewDict()
for infohash, scrape := range resp.Files {
filesDict[string(infohash[:])] = bencode.Dict{
for _, scrape := range resp.Files {
filesDict[string(scrape.InfoHash[:])] = bencode.Dict{
"complete": scrape.Complete,
"incomplete": scrape.Incomplete,
}