diff --git a/frontend/http/frontend.go b/frontend/http/frontend.go index 48cedf9..6f976cf 100644 --- a/frontend/http/frontend.go +++ b/frontend/http/frontend.go @@ -136,7 +136,7 @@ func (t *Frontend) announceRoute(w http.ResponseWriter, r *http.Request, _ httpr return } - resp, err := t.logic.HandleAnnounce(context.TODO(), req) + resp, err := t.logic.HandleAnnounce(context.Background(), req) if err != nil { WriteError(w, err) return @@ -148,7 +148,7 @@ func (t *Frontend) announceRoute(w http.ResponseWriter, r *http.Request, _ httpr return } - go t.logic.AfterAnnounce(context.TODO(), req, resp) + go t.logic.AfterAnnounce(context.Background(), req, resp) } // scrapeRoute parses and responds to a Scrape by using t.TrackerLogic. @@ -163,7 +163,7 @@ func (t *Frontend) scrapeRoute(w http.ResponseWriter, r *http.Request, _ httprou return } - resp, err := t.logic.HandleScrape(context.TODO(), req) + resp, err := t.logic.HandleScrape(context.Background(), req) if err != nil { WriteError(w, err) return @@ -175,5 +175,5 @@ func (t *Frontend) scrapeRoute(w http.ResponseWriter, r *http.Request, _ httprou return } - go t.logic.AfterScrape(context.TODO(), req, resp) + go t.logic.AfterScrape(context.Background(), req, resp) } diff --git a/frontend/udp/frontend.go b/frontend/udp/frontend.go index 1cf3d03..757ec13 100644 --- a/frontend/udp/frontend.go +++ b/frontend/udp/frontend.go @@ -203,7 +203,7 @@ func (t *Frontend) handleRequest(r Request, w ResponseWriter) (actionName string } var resp *bittorrent.AnnounceResponse - resp, err = t.logic.HandleAnnounce(context.TODO(), req) + resp, err = t.logic.HandleAnnounce(context.Background(), req) if err != nil { WriteError(w, txID, err) return @@ -211,7 +211,7 @@ func (t *Frontend) handleRequest(r Request, w ResponseWriter) (actionName string WriteAnnounce(w, txID, resp) - go t.logic.AfterAnnounce(context.TODO(), req, resp) + go t.logic.AfterAnnounce(context.Background(), req, resp) return @@ -226,7 +226,7 @@ func (t *Frontend) handleRequest(r Request, w ResponseWriter) (actionName string } var resp *bittorrent.ScrapeResponse - resp, err = t.logic.HandleScrape(context.TODO(), req) + resp, err = t.logic.HandleScrape(context.Background(), req) if err != nil { WriteError(w, txID, err) return @@ -234,7 +234,7 @@ func (t *Frontend) handleRequest(r Request, w ResponseWriter) (actionName string WriteScrape(w, txID, resp) - go t.logic.AfterScrape(context.TODO(), req, resp) + go t.logic.AfterScrape(context.Background(), req, resp) return