Addes OOM handling for curl_easy_setopt() calls in test

This commit is contained in:
Yang Tse
2010-02-05 18:07:19 +00:00
parent 12d01bc5f7
commit cad9c3f55f
50 changed files with 744 additions and 439 deletions

View File

@@ -23,7 +23,7 @@
int test(char *URL)
{
CURL *c;
CURLM *m;
CURLM *m = NULL;
int res = 0;
int running=1;
struct timeval mp_start;
@@ -40,7 +40,7 @@ int test(char *URL)
return TEST_ERR_MAJOR_BAD;
}
curl_easy_setopt(c, CURLOPT_URL, URL);
test_setopt(c, CURLOPT_URL, URL);
if ((m = curl_multi_init()) == NULL) {
fprintf(stderr, "curl_multi_init() failed\n");
@@ -81,9 +81,13 @@ int test(char *URL)
res = TEST_ERR_RUNS_FOREVER;
}
curl_multi_remove_handle(m, c);
test_cleanup:
if(m) {
curl_multi_remove_handle(m, c);
curl_multi_cleanup(m);
}
curl_easy_cleanup(c);
curl_multi_cleanup(m);
curl_global_cleanup();
return res;