mirror of
https://github.com/sot-tech/mochi.git
synced 2026-06-11 23:43:29 -07:00
udp: add scrape address length to context
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/chihaya/chihaya/bittorrent"
|
||||
"github.com/chihaya/chihaya/frontend"
|
||||
"github.com/chihaya/chihaya/frontend/udp/bytepool"
|
||||
"github.com/chihaya/chihaya/middleware"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -222,8 +223,10 @@ func (t *Frontend) handleRequest(r Request, w ResponseWriter) (actionName string
|
||||
return
|
||||
}
|
||||
|
||||
ctx := context.WithValue(context.Background(), middleware.ScrapeIsIPv6Key, len(r.IP) == net.IPv6len)
|
||||
|
||||
var resp *bittorrent.ScrapeResponse
|
||||
resp, err = t.logic.HandleScrape(context.Background(), req)
|
||||
resp, err = t.logic.HandleScrape(ctx, req)
|
||||
if err != nil {
|
||||
WriteError(w, txID, err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user