Skip to content

Commit

Permalink
Expose "disable TCP/uTP" torrent client options. (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
pataquets committed Feb 21, 2024
1 parent a8166eb commit cced772
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ type TorrentGlobal struct {
GlobalCacheSize int64 `yaml:"global_cache_size,omitempty"`
MetadataFolder string `yaml:"metadata_folder,omitempty"`
DisableIPv6 bool `yaml:"disable_ipv6,omitempty"`
DisableTCP bool `yaml:"disable_tcp,omitempty"`
DisableUTP bool `yaml:"disable_utp,omitempty"`
IP string `yaml:"ip,omitempty"`
}

Expand Down
6 changes: 6 additions & 0 deletions templates/config_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ torrent:
# Disable IPv6.
#disable_ipv6: true

# Disable TCP.
#disable_tcp: false

# Disable uTP.
#disable_utp: false

# Do not stop distribyted if some of the torrents are not able to load the info correctly on startup.
continue_when_add_timeout: false

Expand Down
2 changes: 2 additions & 0 deletions torrent/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ func NewClient(st storage.ClientImpl, fis bep44.Store, cfg *config.TorrentGlobal
torrentCfg.PeerID = string(id[:])
torrentCfg.DefaultStorage = st
torrentCfg.DisableIPv6 = cfg.DisableIPv6
torrentCfg.DisableTCP = cfg.DisableTCP
torrentCfg.DisableUTP = cfg.DisableUTP

if cfg.IP != "" {
ip := net.ParseIP(cfg.IP)
Expand Down

0 comments on commit cced772

Please sign in to comment.