]> granicus.if.org Git - curl/commitdiff
curl: remove dead code
authorDaniel Stenberg <daniel@haxx.se>
Sun, 21 Jul 2019 11:11:23 +0000 (13:11 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 21 Jul 2019 21:42:35 +0000 (23:42 +0200)
The loop never loops (since b889408500), pointed out by Coverity (CID
1451702)

Closes #4133

src/tool_operate.c

index 1b3bec9cfc89a71760b3335c2cb36a4b1ca615d5..238d87c9fd0c75a09e92eb8813a0e1432f15e30d 100644 (file)
@@ -1827,36 +1827,30 @@ static CURLcode create_transfers(struct GlobalConfig *global,
           my_setopt_str(curl, CURLOPT_ALTSVC, config->altsvc);
 #endif
 
-        for(;;) {
 #ifdef USE_METALINK
-          if(!metalink && config->use_metalink) {
-            outs->metalink_parser = metalink_parser_context_new();
-            if(outs->metalink_parser == NULL) {
-              result = CURLE_OUT_OF_MEMORY;
-              goto show_error;
-            }
-            fprintf(config->global->errors,
-                    "Metalink: parsing (%s) metalink/XML...\n", per->this_url);
+        if(!metalink && config->use_metalink) {
+          outs->metalink_parser = metalink_parser_context_new();
+          if(outs->metalink_parser == NULL) {
+            result = CURLE_OUT_OF_MEMORY;
+            goto show_error;
           }
-          else if(metalink)
-            fprintf(config->global->errors,
-                    "Metalink: fetching (%s) from (%s)...\n",
-                    mlfile->filename, per->this_url);
+          fprintf(config->global->errors,
+                  "Metalink: parsing (%s) metalink/XML...\n", per->this_url);
+        }
+        else if(metalink)
+          fprintf(config->global->errors,
+                  "Metalink: fetching (%s) from (%s)...\n",
+                  mlfile->filename, per->this_url);
 #endif /* USE_METALINK */
 
-          per->metalink = metalink;
-          /* initialize retry vars for loop below */
-          per->retry_sleep_default = (config->retry_delay) ?
-            config->retry_delay*1000L : RETRY_SLEEP_DEFAULT; /* ms */
-          per->retry_numretries = config->req_retry;
-          per->retry_sleep = per->retry_sleep_default; /* ms */
-          per->retrystart = tvnow();
-
+        per->metalink = metalink;
+        /* initialize retry vars for loop below */
+        per->retry_sleep_default = (config->retry_delay) ?
+          config->retry_delay*1000L : RETRY_SLEEP_DEFAULT; /* ms */
+        per->retry_numretries = config->req_retry;
+        per->retry_sleep = per->retry_sleep_default; /* ms */
+        per->retrystart = tvnow();
 
-          /* In all ordinary cases, just break out of loop here */
-          break; /* curl_easy_perform loop */
-
-        }
       } /* loop to the next URL */
 
       show_error: