- Clamp --parallel-max to MAX_PARALLEL (300) instead of resetting to
default value.
Previously, --parallel-max 300 would use 300 concurrent transfers, but
--parallel-max 301 would unexpectedly use only 50. This change clamps
higher values to the maximum (ie --parallel-max 301 would use 300).
Closes https://github.com/curl/curl/pull/8930
err = str2unum(&global->parallel_max, nextarg);
if(err)
return err;
- if((global->parallel_max > MAX_PARALLEL) ||
- (global->parallel_max < 1))
+ if(global->parallel_max > MAX_PARALLEL)
+ global->parallel_max = MAX_PARALLEL;
+ else if(global->parallel_max < 1)
global->parallel_max = PARALLEL_DEFAULT;
break;
case 'c': /* --parallel-connect */