summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-07-17 16:10:27 +0200
committerGravatar Nikias Bassen2012-07-17 16:10:27 +0200
commitb28d4534d92e0385206401d0e9c0cd64206df3b1 (patch)
treec13ab6231a74b02db7cb9cfdd1fa0bcf126e4ad9 /src
parent2a2444689467c81f49cf84004361ed004df79d95 (diff)
downloadidevicerestore-b28d4534d92e0385206401d0e9c0cd64206df3b1.tar.gz
idevicerestore-b28d4534d92e0385206401d0e9c0cd64206df3b1.tar.bz2
download: Enable curl verbose mode if debug flag is enabled
Diffstat (limited to 'src')
-rw-r--r--src/download.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/download.c b/src/download.c
index 6222502..603342a 100644
--- a/src/download.c
+++ b/src/download.c
@@ -61,6 +61,9 @@ int download_to_buffer(const char* url, char** buf, uint32_t* length)
response.content = malloc(1);
response.content[0] = '\0';
+ if (idevicerestore_debug)
+ curl_easy_setopt(handle, CURLOPT_VERBOSE, 1);
+
curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, (curl_write_callback)&download_write_buffer_callback);
curl_easy_setopt(handle, CURLOPT_WRITEDATA, &response);
curl_easy_setopt(handle, CURLOPT_USERAGENT, "InetURL/1.0");
@@ -115,6 +118,10 @@ int download_to_file(const char* url, const char* filename)
}
lastprogress = 0;
+
+ if (idevicerestore_debug)
+ curl_easy_setopt(handle, CURLOPT_VERBOSE, 1);
+
curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, (curl_write_callback)&fwrite);
curl_easy_setopt(handle, CURLOPT_WRITEDATA, f);
curl_easy_setopt(handle, CURLOPT_PROGRESSFUNCTION, (curl_progress_callback)&download_progress);