From 1e812367fb4f7579870e336767f3c59b0fd502c8 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Fri, 21 Mar 2014 21:04:28 +0100 Subject: move curl_global_init/_cleanup to a global context --- src/download.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/download.c') diff --git a/src/download.c b/src/download.c index 19af28e..6adc523 100644 --- a/src/download.c +++ b/src/download.c @@ -50,7 +50,6 @@ static size_t download_write_buffer_callback(char* data, size_t size, size_t nme int download_to_buffer(const char* url, char** buf, uint32_t* length) { int res = 0; - curl_global_init(CURL_GLOBAL_ALL); CURL* handle = curl_easy_init(); if (handle == NULL) { error("ERROR: could not initialize CURL\n"); @@ -84,8 +83,6 @@ int download_to_buffer(const char* url, char** buf, uint32_t* length) res = -1; } - curl_global_cleanup(); - return res; } @@ -108,7 +105,6 @@ static int download_progress(void *clientp, double dltotal, double dlnow, double int download_to_file(const char* url, const char* filename, int enable_progress) { int res = 0; - curl_global_init(CURL_GLOBAL_ALL); CURL* handle = curl_easy_init(); if (handle == NULL) { error("ERROR: could not initialize CURL\n"); @@ -151,7 +147,5 @@ int download_to_file(const char* url, const char* filename, int enable_progress) remove(filename); } - curl_global_cleanup(); - return res; } -- cgit v1.1-32-gdbae