2
0
mirror of synced 2025-02-23 22:28:11 +00:00

Don't use AnnounceHandler by value

It needs to share mutex for upstream tracker single flight handling.
This commit is contained in:
Matt Joiner 2022-12-12 11:23:33 +11:00
parent 0a4de1821e
commit cfe166c745
No known key found for this signature in database
GPG Key ID: 6B990B8185E7F782
2 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ import (
)
type Handler struct {
Announce tracker.AnnounceHandler
Announce *tracker.AnnounceHandler
// Called to derive an announcer's IP if non-nil. If not specified, the Request.RemoteAddr is
// used. Necessary for instances running behind reverse proxies for example.
RequestHost func(r *http.Request) (netip.Addr, error)

View File

@ -32,7 +32,7 @@ type AnnounceTracker = tracker.AnnounceTracker
type Server struct {
ConnTracker ConnectionTracker
SendResponse func(data []byte, addr net.Addr) (int, error)
Announce tracker.AnnounceHandler
Announce *tracker.AnnounceHandler
}
type RequestSourceAddr = net.Addr