1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-23 00:28: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:
Yang Tse 2011-10-22 14:46:49 +02:00
parent d7934b8bd4
commit cc76bbe79b

View File

@ -1208,12 +1208,13 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
retry_sleep = retry_sleep_default; /* ms */ retry_sleep = retry_sleep_default; /* ms */
retrystart = tvnow(); retrystart = tvnow();
if(!curl_slist_append(easysrc, "ret = curl_easy_perform(hnd);")) {
res = CURLE_OUT_OF_MEMORY;
goto show_error;
}
for(;;) { for(;;) {
res = curl_easy_perform(curl); 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 && if(config->content_disposition && outs.stream && !config->mute &&
outs.filename) outs.filename)