mirror of
https://github.com/curl/curl.git
synced 2024-12-15 06:40:09 +08:00
tool_operate: fix add_parallel_transfers when more are in queue
Trying to return early from the function if no new transfers were added would break the "morep" argument and cause issues. This could lead to zero content "transfers" (within quotes since they would never be started) when parallel-max was reduced. Reported-by: Gavin Wong Analyzed-by: Jay Satiro Fixes #4937 Closes #5112
This commit is contained in:
parent
2eba5e4c7b
commit
95c36fff75
@ -2055,7 +2055,7 @@ static CURLcode add_parallel_transfers(struct GlobalConfig *global,
|
||||
*addedp = FALSE;
|
||||
*morep = FALSE;
|
||||
result = create_transfer(global, share, addedp);
|
||||
if(result || !*addedp)
|
||||
if(result)
|
||||
return result;
|
||||
for(per = transfers; per && (all_added < global->parallel_max);
|
||||
per = per->next) {
|
||||
|
Loading…
Reference in New Issue
Block a user