Merge pull request #292 from mrd0ll4r/frontend-fix

frontend: fix recording of address family
This commit is contained in:
mrd0ll4r 2017-02-05 23:14:01 +01:00 committed by GitHub
commit 82d79e5113
2 changed files with 4 additions and 0 deletions

View file

@ -166,6 +166,7 @@ func (t *Frontend) announceRoute(w http.ResponseWriter, r *http.Request, _ httpr
WriteError(w, err)
return
}
af = new(bittorrent.AddressFamily)
*af = req.IP.AddressFamily
resp, err := t.logic.HandleAnnounce(context.Background(), req)
@ -213,6 +214,7 @@ func (t *Frontend) scrapeRoute(w http.ResponseWriter, r *http.Request, _ httprou
WriteError(w, ErrInvalidIP)
return
}
af = new(bittorrent.AddressFamily)
*af = req.AddressFamily
resp, err := t.logic.HandleScrape(context.Background(), req)

View file

@ -232,6 +232,7 @@ func (t *Frontend) handleRequest(r Request, w ResponseWriter) (actionName string
WriteError(w, txID, err)
return
}
af = new(bittorrent.AddressFamily)
*af = req.IP.AddressFamily
var resp *bittorrent.AnnounceResponse
@ -264,6 +265,7 @@ func (t *Frontend) handleRequest(r Request, w ResponseWriter) (actionName string
WriteError(w, txID, ErrInvalidIP)
return
}
af = new(bittorrent.AddressFamily)
*af = req.AddressFamily
var resp *bittorrent.ScrapeResponse