Log and handle error with bad tracker URLs

This commit is contained in:
Matt Joiner 2018-06-17 16:19:24 +10:00
parent 3a17708c78
commit 4fafad46b2
1 changed files with 4 additions and 1 deletions

View File

@ -1284,7 +1284,10 @@ func (t *Torrent) startScrapingTracker(_url string) {
if _url == "" {
return
}
u, _ := url.Parse(_url)
u, err := url.Parse(_url)
if err != nil {
log.Str("error parsing tracker url").AddValues("url", _url).Log(t.logger)
}
if u.Scheme == "udp" {
u.Scheme = "udp4"
t.startScrapingTracker(u.String())