diff options
author | Martin Szulecki | 2013-02-26 03:20:56 +0100 |
---|---|---|
committer | Martin Szulecki | 2013-02-26 03:20:56 +0100 |
commit | fcc1bb855efb6860417ed827d3b50feba24a9a8b (patch) | |
tree | 47d3c7d6a985dc647f7962329014c8116d657cc9 /dev/afccheck.c | |
parent | 3b54aac30447bc02fafd721a63a752968628e7e0 (diff) | |
download | libimobiledevice-fcc1bb855efb6860417ed827d3b50feba24a9a8b.tar.gz libimobiledevice-fcc1bb855efb6860417ed827d3b50feba24a9a8b.tar.bz2 |
Refactor port number use into service descriptor to enable SSL for services
This is a major change which breaks API but is required in order to support
SSL communication for services as used by network connections.
Diffstat (limited to 'dev/afccheck.c')
-rw-r--r-- | dev/afccheck.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/dev/afccheck.c b/dev/afccheck.c index 2dab6db..ead0ca0 100644 --- a/dev/afccheck.c +++ b/dev/afccheck.c @@ -92,7 +92,7 @@ int main(int argc, char *argv[]) { lockdownd_client_t client = NULL; idevice_t phone = NULL; - uint16_t port = 0; + lockdownd_service_descriptor_t service = NULL; afc_client_t afc = NULL; if (argc > 1 && !strcasecmp(argv[1], "--debug")) { @@ -111,14 +111,19 @@ int main(int argc, char *argv[]) return 1; } - if (LOCKDOWN_E_SUCCESS == lockdownd_start_service(client, "com.apple.afc", &port) && !port) { + if (LOCKDOWN_E_SUCCESS == lockdownd_start_service(client, "com.apple.afc", &service) && !service->port) { lockdownd_client_free(client); idevice_free(phone); fprintf(stderr, "Something went wrong when starting AFC."); return 1; } - afc_client_new(phone, port, &afc); + afc_client_new(phone, service, &afc); + + if (service) { + lockdownd_service_descriptor_free(service); + service = NULL; + } pthread_t threads[NB_THREADS]; param data[NB_THREADS]; |