diff options
author | Dan Fandrich <dan@coneharvesters.com> | 2014-01-29 00:14:35 +0100 |
---|---|---|
committer | Dan Fandrich <dan@coneharvesters.com> | 2014-01-29 00:19:34 +0100 |
commit | d735d3e803bca23d782ab0791896a6b29fcd9eb2 (patch) | |
tree | 6436a4043305a3fcae32849b9ae75cc06843bc7f /tests/libtest/lib1900.c | |
parent | 1a20f592376cc0071505e935db35d75b08fb35aa (diff) |
lib1900: make the test pass the OOM torture tests
Diffstat (limited to 'tests/libtest/lib1900.c')
-rw-r--r-- | tests/libtest/lib1900.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/tests/libtest/lib1900.c b/tests/libtest/lib1900.c index 74a0e6f58..fa83130b6 100644 --- a/tests/libtest/lib1900.c +++ b/tests/libtest/lib1900.c @@ -38,12 +38,6 @@ int num_handles; int blacklist_num_servers; int blacklist_num_sites; -int parse_url_file(const char *filename); -void free_urls(void); -int create_handles(void); -void setup_handle(char *base_url, CURLM *m, int handlenum); -void remove_handles(void); - static size_t write_callback(void *contents, size_t size, size_t nmemb, void *userp) { @@ -54,7 +48,7 @@ write_callback(void *contents, size_t size, size_t nmemb, void *userp) return realsize; } -int parse_url_file(const char *filename) +static int parse_url_file(const char *filename) { FILE *f; int filetime; @@ -91,21 +85,21 @@ int parse_url_file(const char *filename) return num_handles; } -void free_urls(void) +static void free_urls(void) { int i; for(i = 0;i < num_handles;i++) { - free(urlstring[i]); + Curl_safefree(urlstring[i]); } for(i = 0;i < blacklist_num_servers;i++) { - free(server_blacklist[i]); + Curl_safefree(server_blacklist[i]); } for(i = 0;i < blacklist_num_sites;i++) { - free(site_blacklist[i]); + Curl_safefree(site_blacklist[i]); } } -int create_handles(void) +static int create_handles(void) { int i; @@ -115,7 +109,7 @@ int create_handles(void) return 0; } -void setup_handle(char *base_url, CURLM *m, int handlenum) +static void setup_handle(char *base_url, CURLM *m, int handlenum) { char urlbuf[256]; @@ -128,7 +122,7 @@ void setup_handle(char *base_url, CURLM *m, int handlenum) curl_multi_add_handle(m, handles[handlenum]); } -void remove_handles(void) +static void remove_handles(void) { int i; @@ -155,7 +149,7 @@ int test(char *URL) curl_global_init(CURL_GLOBAL_ALL); - m = curl_multi_init(); + multi_init(m); create_handles(); |