cmd/tracker-announce: Was using empty AnnounceRequest
This commit is contained in:
parent
066809403a
commit
8b4a4193a8
|
@ -47,16 +47,16 @@ func main() {
|
||||||
for _, tier := range ts.Trackers {
|
for _, tier := range ts.Trackers {
|
||||||
for _, tURI := range tier {
|
for _, tURI := range tier {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go doTracker(tURI, wg.Done)
|
go doTracker(tURI, wg.Done, ar)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
}
|
}
|
||||||
|
|
||||||
func doTracker(tURI string, done func()) {
|
func doTracker(tURI string, done func(), ar tracker.AnnounceRequest) {
|
||||||
defer done()
|
defer done()
|
||||||
for _, res := range announces(tURI) {
|
for _, res := range announces(tURI, ar) {
|
||||||
err := res.error
|
err := res.error
|
||||||
resp := res.AnnounceResponse
|
resp := res.AnnounceResponse
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -72,12 +72,13 @@ type announceResult struct {
|
||||||
error
|
error
|
||||||
}
|
}
|
||||||
|
|
||||||
func announces(uri string) (ret []announceResult) {
|
func announces(uri string, ar tracker.AnnounceRequest) (ret []announceResult) {
|
||||||
u, err := url.Parse(uri)
|
u, err := url.Parse(uri)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return []announceResult{{error: err}}
|
return []announceResult{{error: err}}
|
||||||
}
|
}
|
||||||
a := tracker.Announce{
|
a := tracker.Announce{
|
||||||
|
Request: ar,
|
||||||
TrackerUrl: uri,
|
TrackerUrl: uri,
|
||||||
}
|
}
|
||||||
if u.Scheme == "udp" {
|
if u.Scheme == "udp" {
|
||||||
|
|
Loading…
Reference in New Issue