fs: make sure --low-level-retries, --checkers, --transfers are > 0

This commit is contained in:
Nick Craig-Wood 2021-02-16 17:54:13 +00:00
parent 301e1ad982
commit 294f090361

View file

@ -275,6 +275,15 @@ func SetFlags(ci *fs.ConfigInfo) {
multiThreadStreamsFlag := pflag.Lookup("multi-thread-streams")
ci.MultiThreadSet = multiThreadStreamsFlag != nil && multiThreadStreamsFlag.Changed
// Make sure some values are > 0
nonZero := func(pi *int) {
if *pi <= 0 {
*pi = 1
}
}
nonZero(&ci.LowLevelRetries)
nonZero(&ci.Transfers)
nonZero(&ci.Checkers)
}
// parseHeaders converts DSCP names to value