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. --- tools/idevicesyslog.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'tools/idevicesyslog.c') diff --git a/tools/idevicesyslog.c b/tools/idevicesyslog.c index a17999c..6ce6d0e 100644 --- a/tools/idevicesyslog.c +++ b/tools/idevicesyslog.c @@ -49,7 +49,7 @@ int main(int argc, char *argv[]) idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; int i; const char* udid = NULL; - uint16_t port = 0; + lockdownd_service_descriptor_t service = NULL; signal(SIGINT, clean_exit); signal(SIGTERM, clean_exit); @@ -99,13 +99,13 @@ int main(int argc, char *argv[]) } /* start syslog_relay service and retrieve port */ - ret = lockdownd_start_service(client, "com.apple.syslog_relay", &port); - if ((ret == LOCKDOWN_E_SUCCESS) && port) { + ret = lockdownd_start_service(client, "com.apple.syslog_relay", &service); + if ((ret == LOCKDOWN_E_SUCCESS) && service->port) { lockdownd_client_free(client); - + /* connect to socket relay messages */ idevice_connection_t conn = NULL; - if ((idevice_connect(device, port, &conn) != IDEVICE_E_SUCCESS) || !conn) { + if ((idevice_connect(device, service->port, &conn) != IDEVICE_E_SUCCESS) || !conn) { printf("ERROR: Could not open usbmux connection.\n"); } else { while (!quit_flag) { @@ -126,6 +126,9 @@ int main(int argc, char *argv[]) printf("ERROR: Could not start service com.apple.syslog_relay.\n"); } + if (service) + lockdownd_service_descriptor_free(service); + idevice_free(device); return 0; -- cgit v1.1-32-gdbae