mirror of
https://github.com/curl/curl.git
synced 2025-03-13 15:37:04 +08:00
tool_getparam: fix --parallel-max maximum value constraint
- 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
This commit is contained in:
parent
f51ffdb35f
commit
10cd69623a
@ -2337,8 +2337,9 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
||||
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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user