summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2012-07-17 19:46:09 +0200
committerGravatar Nikias Bassen2012-07-17 19:46:09 +0200
commit2c362a775310d8d7caf29f2c396f999cc88a0233 (patch)
tree0c6f9b6d2fc24b7c211c2ab56a72b400df17133a
parent8262bf2271dd4a300720ecb28d866ee68900d045 (diff)
downloadidevicerestore-2c362a775310d8d7caf29f2c396f999cc88a0233.tar.gz
idevicerestore-2c362a775310d8d7caf29f2c396f999cc88a0233.tar.bz2
tss: Cycle through different hosts for TSS requests as a fallback
It appears the number of HTTP requests from one IP to the TSS signing servers is limited by each signing host. This workaround increases the volume of devices that can be processed due to falling back to another signing host in case request limiting is in effect by the original host.
-rw-r--r--src/tss.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/tss.c b/src/tss.c
index 98b651c..e505e6e 100644
--- a/src/tss.c
+++ b/src/tss.c
@@ -323,6 +323,12 @@ plist_t tss_send_request(plist_t tss_request) {
unsigned int size = 0;
char curl_error_message[CURL_ERROR_SIZE];
+ const char* urls[3] = {
+ "http://gs.apple.com/TSS/controller?action=2",
+ "http://17.171.36.30/TSS/controller?action=2",
+ "http://17.151.36.30/TSS/controller?action=2"
+ };
+
plist_to_xml(tss_request, &request, &size);
tss_response* response = NULL;
@@ -359,7 +365,9 @@ plist_t tss_send_request(plist_t tss_request) {
if (use_apple_server==0) {
curl_easy_setopt(handle, CURLOPT_URL, "http://cydia.saurik.com/TSS/controller?action=2");
} else {
- curl_easy_setopt(handle, CURLOPT_URL, "http://gs.apple.com/TSS/controller?action=2");
+ int url_index = (retry - 1) % 3;
+ curl_easy_setopt(handle, CURLOPT_URL, urls[url_index]);
+ info("Request URL set to %s\n", urls[url_index]);
}
info("Sending TSS request attempt %d... ", retry);