From e24a9b343f24088ee6c54983b6317ce9aef23a58 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Fri, 3 Jan 2020 14:49:43 +1100 Subject: [PATCH] cmd/torrent: Add dht flag --- cmd/torrent/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/torrent/main.go b/cmd/torrent/main.go index d188a0a5..03582ab6 100644 --- a/cmd/torrent/main.go +++ b/cmd/torrent/main.go @@ -140,12 +140,14 @@ var flags = struct { PublicIP net.IP Progress bool Quiet bool `help:"discard client logging"` + Dht bool tagflag.StartPos Torrent []string `arity:"+" help:"torrent file path or magnet uri"` }{ UploadRate: -1, DownloadRate: -1, Progress: true, + Dht: true, } func stdoutAndStderrAreSameFile() bool { @@ -181,6 +183,7 @@ func mainErr() error { tagflag.Parse(&flags) defer envpprof.Stop() clientConfig := torrent.NewDefaultClientConfig() + clientConfig.NoDHT = !flags.Dht clientConfig.Debug = flags.Debug clientConfig.Seed = flags.Seed clientConfig.PublicIp4 = flags.PublicIP -- 2.48.1