From fcc1bb855efb6860417ed827d3b50feba24a9a8b Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Tue, 26 Feb 2013 03:20:56 +0100 Subject: 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. --- dev/afccheck.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'dev/afccheck.c') 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]; -- cgit v1.1-32-gdbae