diff options
| author | 2013-02-26 03:20:56 +0100 | |
|---|---|---|
| committer | 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[]) | |||
| 92 | { | 92 | { |
| 93 | lockdownd_client_t client = NULL; | 93 | lockdownd_client_t client = NULL; |
| 94 | idevice_t phone = NULL; | 94 | idevice_t phone = NULL; |
| 95 | uint16_t port = 0; | 95 | lockdownd_service_descriptor_t service = NULL; |
| 96 | afc_client_t afc = NULL; | 96 | afc_client_t afc = NULL; |
| 97 | 97 | ||
| 98 | if (argc > 1 && !strcasecmp(argv[1], "--debug")) { | 98 | if (argc > 1 && !strcasecmp(argv[1], "--debug")) { |
| @@ -111,14 +111,19 @@ int main(int argc, char *argv[]) | |||
| 111 | return 1; | 111 | return 1; |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | if (LOCKDOWN_E_SUCCESS == lockdownd_start_service(client, "com.apple.afc", &port) && !port) { | 114 | if (LOCKDOWN_E_SUCCESS == lockdownd_start_service(client, "com.apple.afc", &service) && !service->port) { |
| 115 | lockdownd_client_free(client); | 115 | lockdownd_client_free(client); |
| 116 | idevice_free(phone); | 116 | idevice_free(phone); |
| 117 | fprintf(stderr, "Something went wrong when starting AFC."); | 117 | fprintf(stderr, "Something went wrong when starting AFC."); |
| 118 | return 1; | 118 | return 1; |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | afc_client_new(phone, port, &afc); | 121 | afc_client_new(phone, service, &afc); |
| 122 | |||
| 123 | if (service) { | ||
| 124 | lockdownd_service_descriptor_free(service); | ||
| 125 | service = NULL; | ||
| 126 | } | ||
| 122 | 127 | ||
| 123 | pthread_t threads[NB_THREADS]; | 128 | pthread_t threads[NB_THREADS]; |
| 124 | param data[NB_THREADS]; | 129 | param data[NB_THREADS]; |
