diff options
author | Nikias Bassen | 2012-01-31 21:16:34 +0100 |
---|---|---|
committer | Nikias Bassen | 2012-01-31 21:16:34 +0100 |
commit | 3b85559e4c7fe591a314b5a47763ad367888be66 (patch) | |
tree | 504496f6293bd7959753f0a94e61f19847356fcf /src/libirecovery.c | |
parent | ecccb434ac5e22062bbf5c4e38e0c2f1153c1db0 (diff) | |
download | idevicerestore-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.c | 4 |
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); |