Move curl_easy_perform source code geneartion out of curl_easy_perform's loop
for proper OOM handling and source code geneartion.
retry_sleep = retry_sleep_default; /* ms */
retrystart = tvnow();
+ if(!curl_slist_append(easysrc, "ret = curl_easy_perform(hnd);")) {
+ res = CURLE_OUT_OF_MEMORY;
+ goto show_error;
+ }
+
for(;;) {
res = curl_easy_perform(curl);
- if(!curl_slist_append(easysrc, "ret = curl_easy_perform(hnd);")) {
- res = CURLE_OUT_OF_MEMORY;
- goto show_error;
- }
if(config->content_disposition && outs.stream && !config->mute &&
outs.filename)