]> granicus.if.org Git - curl/commitdiff
curl: exit the create_transfers loop on errors
authorDaniel Stenberg <daniel@haxx.se>
Sat, 21 Sep 2019 21:46:41 +0000 (23:46 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 22 Sep 2019 10:27:58 +0000 (12:27 +0200)
When looping around the ranges and given URLs to create transfers, all
errors should exit the loop and return. Previously it would keep
looping.

Reported-by: SumatraPeter on github
Bug: #4393
Closes #4396

src/tool_operate.c

index 316951869b62ebbcaef425af1ab547935f0427d7..ede816d343f97dbdfa0172000ada0ca1e2f8617b 100644 (file)
@@ -1885,15 +1885,9 @@ static CURLcode create_transfers(struct GlobalConfig *global,
         urls = NULL;
       }
 
-      if(infilenum > 1) {
-        /* when file globbing, exit loop upon critical error */
-        if(is_fatal_error(result))
-          break;
-      }
-      else if(result)
-        /* when not file globbing, exit loop upon any error */
+      if(result)
+        /* exit loop upon error */
         break;
-
     } /* loop to the next globbed upload file */
 
     /* Free loop-local allocated memory */
@@ -1913,6 +1907,9 @@ static CURLcode create_transfers(struct GlobalConfig *global,
     Curl_safefree(urlnode->infile);
     urlnode->flags = 0;
 
+    if(result)
+      /* exit loop upon error */
+      break;
   } /* for-loop through all URLs */
   quit_curl: