diff options
-rw-r--r-- | src/common.h | 2 | ||||
-rw-r--r-- | src/download.c | 4 | ||||
-rw-r--r-- | src/tss.c | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/src/common.h b/src/common.h index 5f1d763..3044d2a 100644 --- a/src/common.h +++ b/src/common.h @@ -53,6 +53,8 @@ extern "C" { #define IBOOT_FLAG_EFFECTIVE_SECURITY_MODE 1 << 3 #define IBOOT_FLAG_EFFECTIVE_PRODUCTION_MODE 1 << 4 +#define USER_AGENT_STRING "InetURL/1.0" + struct dfu_client_t; struct normal_client_t; struct restore_client_t; diff --git a/src/download.c b/src/download.c index 82087df..fab6bba 100644 --- a/src/download.c +++ b/src/download.c @@ -65,7 +65,7 @@ int download_to_buffer(const char* url, char** buf, uint32_t* length) 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"); + curl_easy_setopt(handle, CURLOPT_USERAGENT, USER_AGENT_STRING); curl_easy_setopt(handle, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(handle, CURLOPT_URL, url); @@ -128,7 +128,7 @@ int download_to_file(const char* url, const char* filename, int enable_progress) curl_easy_setopt(handle, CURLOPT_PROGRESSFUNCTION, (curl_progress_callback)&download_progress); curl_easy_setopt(handle, CURLOPT_NOPROGRESS, enable_progress > 0 ? 0: 1); - curl_easy_setopt(handle, CURLOPT_USERAGENT, "InetURL/1.0"); + curl_easy_setopt(handle, CURLOPT_USERAGENT, USER_AGENT_STRING); curl_easy_setopt(handle, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(handle, CURLOPT_URL, url); @@ -970,7 +970,7 @@ plist_t tss_request_send(plist_t tss_request, const char* server_url_string) { curl_easy_setopt(handle, CURLOPT_WRITEDATA, response); curl_easy_setopt(handle, CURLOPT_HTTPHEADER, header); curl_easy_setopt(handle, CURLOPT_POSTFIELDS, request); - curl_easy_setopt(handle, CURLOPT_USERAGENT, "InetURL/1.0"); + curl_easy_setopt(handle, CURLOPT_USERAGENT, USER_AGENT_STRING); curl_easy_setopt(handle, CURLOPT_POSTFIELDSIZE, strlen(request)); if (server_url_string) { curl_easy_setopt(handle, CURLOPT_URL, server_url_string); |