cmd/torrent: Add download -tcpPeers and -utpPeers
This commit is contained in:
parent
d592d139bf
commit
3e5c6d3d44
|
@ -139,6 +139,8 @@ var flags = struct {
|
||||||
PieceStates bool
|
PieceStates bool
|
||||||
Quiet bool `help:"discard client logging"`
|
Quiet bool `help:"discard client logging"`
|
||||||
Dht bool
|
Dht bool
|
||||||
|
TcpPeers bool
|
||||||
|
UtpPeers bool
|
||||||
tagflag.StartPos
|
tagflag.StartPos
|
||||||
Torrent []string `arity:"+" help:"torrent file path or magnet uri"`
|
Torrent []string `arity:"+" help:"torrent file path or magnet uri"`
|
||||||
}{
|
}{
|
||||||
|
@ -198,6 +200,8 @@ func downloadErr(args []string, parent *tagflag.Parser) error {
|
||||||
tagflag.ParseArgs(&flags, args, tagflag.Parent(parent))
|
tagflag.ParseArgs(&flags, args, tagflag.Parent(parent))
|
||||||
defer envpprof.Stop()
|
defer envpprof.Stop()
|
||||||
clientConfig := torrent.NewDefaultClientConfig()
|
clientConfig := torrent.NewDefaultClientConfig()
|
||||||
|
clientConfig.DisableTCP = !flags.TcpPeers
|
||||||
|
clientConfig.DisableUTP = !flags.UtpPeers
|
||||||
clientConfig.DisableAcceptRateLimiting = true
|
clientConfig.DisableAcceptRateLimiting = true
|
||||||
clientConfig.NoDHT = !flags.Dht
|
clientConfig.NoDHT = !flags.Dht
|
||||||
clientConfig.Debug = flags.Debug
|
clientConfig.Debug = flags.Debug
|
||||||
|
|
Loading…
Reference in New Issue