diff options
Diffstat (limited to 'src/preflight.c')
| -rw-r--r-- | src/preflight.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/preflight.c b/src/preflight.c index b011344..5198d8c 100644 --- a/src/preflight.c +++ b/src/preflight.c | |||
| @@ -161,17 +161,22 @@ retry: | |||
| 161 | 161 | ||
| 162 | int is_device_paired = 0; | 162 | int is_device_paired = 0; |
| 163 | char *host_id = NULL; | 163 | char *host_id = NULL; |
| 164 | config_device_record_get_host_id(dev->udid, &host_id); | 164 | if (config_has_device_record(dev->udid)) { |
| 165 | lerr = lockdownd_start_session(lockdown, host_id, NULL, NULL); | 165 | config_device_record_get_host_id(dev->udid, &host_id); |
| 166 | free(host_id); | 166 | lerr = lockdownd_start_session(lockdown, host_id, NULL, NULL); |
| 167 | if (lerr == LOCKDOWN_E_SUCCESS) { | 167 | if (host_id) |
| 168 | usbmuxd_log(LL_INFO, "%s: StartSession success for device %s", __func__, _dev->udid); | 168 | free(host_id); |
| 169 | usbmuxd_log(LL_INFO, "%s: Finished preflight on device %s", __func__, _dev->udid); | 169 | if (lerr == LOCKDOWN_E_SUCCESS) { |
| 170 | client_device_add(info); | 170 | usbmuxd_log(LL_INFO, "%s: StartSession success for device %s", __func__, _dev->udid); |
| 171 | goto leave; | 171 | usbmuxd_log(LL_INFO, "%s: Finished preflight on device %s", __func__, _dev->udid); |
| 172 | } | 172 | client_device_add(info); |
| 173 | goto leave; | ||
| 174 | } | ||
| 173 | 175 | ||
| 174 | usbmuxd_log(LL_INFO, "%s: StartSession failed on device %s, lockdown error %d", __func__, _dev->udid, lerr); | 176 | usbmuxd_log(LL_INFO, "%s: StartSession failed on device %s, lockdown error %d", __func__, _dev->udid, lerr); |
| 177 | } else { | ||
| 178 | lerr = LOCKDOWN_E_INVALID_HOST_ID; | ||
| 179 | } | ||
| 175 | switch (lerr) { | 180 | switch (lerr) { |
| 176 | case LOCKDOWN_E_INVALID_HOST_ID: | 181 | case LOCKDOWN_E_INVALID_HOST_ID: |
| 177 | usbmuxd_log(LL_INFO, "%s: Device %s is not paired with this host.", __func__, _dev->udid); | 182 | usbmuxd_log(LL_INFO, "%s: Device %s is not paired with this host.", __func__, _dev->udid); |
