diff --git a/internal/config/config.go b/internal/config/config.go index bb62fd8..2d890a4 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -45,8 +45,8 @@ func Default() Config { BaseDownloadDir: filepath.Join(home, "Downloads", "torrents"), MaxUploadBps: 0, MaxDownloadBps: 0, - PortRangeStart: 42069, - PortRangeEnd: 42069, + PortRangeStart: 42000, + PortRangeEnd: 43000, } } diff --git a/internal/engine/run.go b/internal/engine/run.go index a576963..2898287 100644 --- a/internal/engine/run.go +++ b/internal/engine/run.go @@ -79,6 +79,11 @@ func Run(id string) error { clientCfg := torrent.NewDefaultClientConfig() clientCfg.DataDir = tc.SavePath + // OS-assigned unless a port is claimed from the pool below. The + // library default (42069) would otherwise apply in the ephemeral + // fallback and no-range cases, colliding with whichever torrent holds + // that port -- the exact collision the pool exists to prevent. + clientCfg.ListenPort = 0 // Claim a distinct port from the configured range so this process's // inbound listener never collides with another concurrently-running