summaryrefslogtreecommitdiffstats
path: root/src/libirecovery.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-01-31 21:16:34 +0100
committerGravatar Nikias Bassen2012-01-31 21:16:34 +0100
commit3b85559e4c7fe591a314b5a47763ad367888be66 (patch)
tree504496f6293bd7959753f0a94e61f19847356fcf /src/libirecovery.c
parentecccb434ac5e22062bbf5c4e38e0c2f1153c1db0 (diff)
downloadidevicerestore-3b85559e4c7fe591a314b5a47763ad367888be66.tar.gz
idevicerestore-3b85559e4c7fe591a314b5a47763ad367888be66.tar.bz2
irecv_open_attempts: call irecv_close after a failed attempt
Diffstat (limited to 'src/libirecovery.c')
-rw-r--r--src/libirecovery.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c
index 723ba42..b25f504 100644
--- a/src/libirecovery.c
+++ b/src/libirecovery.c
@@ -460,6 +460,10 @@ irecv_error_t irecv_open_attempts(irecv_client_t* pclient, int attempts) {
int i;
for (i = 0; i < attempts; i++) {
+ if(*pclient) {
+ irecv_close(*pclient);
+ *pclient = NULL;
+ }
if (irecv_open(pclient) != IRECV_E_SUCCESS) {
debug("Connection failed. Waiting 1 sec before retry.\n");
sleep(1);