]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_operate: fix add_parallel_transfers when more are in queue
authorDaniel Stenberg <daniel@haxx.se>
Mon, 16 Mar 2020 08:33:27 +0000 (09:33 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 16 Mar 2020 08:51:34 +0000 (09:51 +0100)
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

src/tool_operate.c

index 4b3caa80c99635c0d2834dad40b792d62d7349ea..ab06b71c5b6c77ccca97dc564adfe46aac613ab9 100644 (file)
@@ -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) {