cmd/torrent: Respect default client max unverified bytes
This commit is contained in:
parent
669c69faac
commit
9f9b02e3dd
|
@ -242,7 +242,7 @@ type DownloadCmd struct {
|
||||||
Mmap bool `help:"memory-map torrent data"`
|
Mmap bool `help:"memory-map torrent data"`
|
||||||
Seed bool `help:"seed after download is complete"`
|
Seed bool `help:"seed after download is complete"`
|
||||||
Addr string `help:"network listen addr"`
|
Addr string `help:"network listen addr"`
|
||||||
MaxUnverifiedBytes tagflag.Bytes `help:"maximum number bytes to have pending verification"`
|
MaxUnverifiedBytes *tagflag.Bytes `help:"maximum number bytes to have pending verification"`
|
||||||
UploadRate *tagflag.Bytes `help:"max piece bytes to send per second"`
|
UploadRate *tagflag.Bytes `help:"max piece bytes to send per second"`
|
||||||
DownloadRate *tagflag.Bytes `help:"max bytes per second down from peers"`
|
DownloadRate *tagflag.Bytes `help:"max bytes per second down from peers"`
|
||||||
PackedBlocklist string
|
PackedBlocklist string
|
||||||
|
@ -324,7 +324,9 @@ func downloadErr(flags downloadFlags) error {
|
||||||
if flags.RequireFastExtension {
|
if flags.RequireFastExtension {
|
||||||
clientConfig.MinPeerExtensions.SetBit(pp.ExtensionBitFast, true)
|
clientConfig.MinPeerExtensions.SetBit(pp.ExtensionBitFast, true)
|
||||||
}
|
}
|
||||||
clientConfig.MaxUnverifiedBytes = flags.MaxUnverifiedBytes.Int64()
|
if flags.MaxUnverifiedBytes != nil {
|
||||||
|
clientConfig.MaxUnverifiedBytes = flags.MaxUnverifiedBytes.Int64()
|
||||||
|
}
|
||||||
|
|
||||||
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
|
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
Loading…
Reference in New Issue