Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
scraperurl/trackerurl empty value fallback to def
Browse files Browse the repository at this point in the history
  • Loading branch information
boypt committed Jan 12, 2020
1 parent e3cde61 commit 68f2194
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,18 @@ func (e *Engine) SetConfig(c Config) {

func (e *Engine) Configure(c Config) error {
//recieve config
e.Lock()
defer e.Unlock()
if c.IncomingPort <= 0 {
return fmt.Errorf("Invalid incoming port (%d)", c.IncomingPort)
}
if c.ScraperURL == "" {
c.ScraperURL = defaultScraperURL
}
if c.TrackerListURL == "" {
c.TrackerListURL = defaultTrackerListURL
}

e.Lock()
defer e.Unlock()
tc := torrent.NewDefaultClientConfig()
tc.ListenPort = c.IncomingPort
tc.DataDir = c.DownloadDirectory
Expand Down

0 comments on commit 68f2194

Please sign in to comment.