mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 16:18:48 -05:00
tool_operate.c: OOM handling fix
Move curl_easy_perform source code geneartion out of curl_easy_perform's loop for proper OOM handling and source code geneartion.
This commit is contained in:
parent
d7934b8bd4
commit
cc76bbe79b
@ -1208,12 +1208,13 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user