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 /tools/idevicedebugserverproxy.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 'tools/idevicedebugserverproxy.c')
-rw-r--r-- | tools/idevicedebugserverproxy.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/idevicedebugserverproxy.c b/tools/idevicedebugserverproxy.c index 3253e6a..32438ad 100644 --- a/tools/idevicedebugserverproxy.c +++ b/tools/idevicedebugserverproxy.c @@ -228,7 +228,7 @@ int main(int argc, char *argv[]) idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; thread_t th; const char* udid = NULL; - uint16_t port = 0; + lockdownd_service_descriptor_t service = NULL; uint16_t local_port = 0; int result = EXIT_SUCCESS; int i; @@ -297,14 +297,14 @@ int main(int argc, char *argv[]) goto leave_cleanup; } - if ((lockdownd_start_service(lockdown, "com.apple.debugserver", &port) != LOCKDOWN_E_SUCCESS) || !port) { + if ((lockdownd_start_service(lockdown, "com.apple.debugserver", &service) != LOCKDOWN_E_SUCCESS) || !service->port) { fprintf(stderr, "Could not start com.apple.debugserver!\nPlease make sure to mount the developer disk image first.\n"); result = EXIT_FAILURE; goto leave_cleanup; } - if (idevice_connect(device, port, &connection) != IDEVICE_E_SUCCESS) { - fprintf(stderr, "Connection to debugserver port %d failed!\n", (int)port); + if (idevice_connect(device, service->port, &connection) != IDEVICE_E_SUCCESS) { + fprintf(stderr, "Connection to debugserver port %d failed!\n", (int)service->port); result = EXIT_FAILURE; goto leave_cleanup; } @@ -320,7 +320,12 @@ int main(int argc, char *argv[]) socket_info.device_connection = connection; socket_info.local_port = local_port; - socket_info.remote_port = port; + socket_info.remote_port = service->port; + + if (service) { + lockdownd_service_descriptor_free(service); + service = NULL; + } /* create local socket */ socket_info.server_fd = socket_create(socket_info.local_port); |