summaryrefslogtreecommitdiffstats
path: root/src/download.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2014-03-21 21:04:28 +0100
committerGravatar Nikias Bassen2014-03-21 21:04:28 +0100
commit1e812367fb4f7579870e336767f3c59b0fd502c8 (patch)
tree533d817f80351bb0e5ba378a9e474439dc1c8ecd /src/download.c
parent454541a3c9c7e6799713639213ecf0c93d2ef224 (diff)
downloadidevicerestore-1e812367fb4f7579870e336767f3c59b0fd502c8.tar.gz
idevicerestore-1e812367fb4f7579870e336767f3c59b0fd502c8.tar.bz2
move curl_global_init/_cleanup to a global context
Diffstat (limited to 'src/download.c')
-rw-r--r--src/download.c6
1 files changed, 0 insertions, 6 deletions
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;
}