mirror of
https://github.com/curl/curl.git
synced 2026-08-24 16:23:34 +03:00
curl: exit the create_transfers loop on errors
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
This commit is contained in:
parent
5ee88eee68
commit
f8a2058533
1 changed files with 5 additions and 8 deletions
|
|
@ -1885,15 +1885,9 @@ static CURLcode create_transfers(struct GlobalConfig *global,
|
||||||
urls = NULL;
|
urls = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(infilenum > 1) {
|
if(result)
|
||||||
/* when file globbing, exit loop upon critical error */
|
/* exit loop upon error */
|
||||||
if(is_fatal_error(result))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if(result)
|
|
||||||
/* when not file globbing, exit loop upon any error */
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
} /* loop to the next globbed upload file */
|
} /* loop to the next globbed upload file */
|
||||||
|
|
||||||
/* Free loop-local allocated memory */
|
/* Free loop-local allocated memory */
|
||||||
|
|
@ -1913,6 +1907,9 @@ static CURLcode create_transfers(struct GlobalConfig *global,
|
||||||
Curl_safefree(urlnode->infile);
|
Curl_safefree(urlnode->infile);
|
||||||
urlnode->flags = 0;
|
urlnode->flags = 0;
|
||||||
|
|
||||||
|
if(result)
|
||||||
|
/* exit loop upon error */
|
||||||
|
break;
|
||||||
} /* for-loop through all URLs */
|
} /* for-loop through all URLs */
|
||||||
quit_curl:
|
quit_curl:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue