diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/download.c | 6 | ||||
| -rw-r--r-- | src/idevicerestore.c | 6 | ||||
| -rw-r--r-- | src/tss.c | 2 | 
3 files changed, 6 insertions, 8 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;  } diff --git a/src/idevicerestore.c b/src/idevicerestore.c index a08d319..6b7fb04 100644 --- a/src/idevicerestore.c +++ b/src/idevicerestore.c @@ -31,6 +31,8 @@  #include <zlib.h>  #include <libgen.h> +#include <curl/curl.h> +  #include "dfu.h"  #include "tss.h"  #include "img3.h" @@ -1138,10 +1140,14 @@ int main(int argc, char* argv[]) {  		client->ipsw = strdup(ipsw);  	} +	curl_global_init(CURL_GLOBAL_ALL); +  	result = idevicerestore_start(client);  	idevicerestore_client_free(client); +	curl_global_cleanup(); +  	return result;  }  #endif @@ -620,7 +620,6 @@ static size_t tss_write_callback(char* data, size_t size, size_t nmemb, tss_resp  }  plist_t tss_request_send(plist_t tss_request, const char* server_url_string) { -	curl_global_init(CURL_GLOBAL_ALL);  	if (idevicerestore_debug) {  		debug_plist(tss_request); @@ -764,7 +763,6 @@ plist_t tss_request_send(plist_t tss_request, const char* server_url_string) {  	}  	free(request); -	curl_global_cleanup();  	return tss_response;  } | 
