summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-07-21 13:11:23 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-07-21 23:42:35 +0200
commit7644abf8e8101910ed86ab2869b7cc4031b27720 (patch)
tree1d6a90003874f8a61d1a69a1cfc213960396e80e /src
parent71299394ef813047ef4f9475665268be2b804278 (diff)
downloadcurl-7644abf8e8101910ed86ab2869b7cc4031b27720.tar.gz
curl: remove dead code
The loop never loops (since b889408500), pointed out by Coverity (CID 1451702) Closes #4133
Diffstat (limited to 'src')
-rw-r--r--src/tool_operate.c44
1 files changed, 19 insertions, 25 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 1b3bec9cf..238d87c9f 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -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: