summaryrefslogtreecommitdiffstats
path: root/tools/idevicesyslog.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2013-02-26 03:20:56 +0100
committerGravatar Martin Szulecki2013-02-26 03:20:56 +0100
commitfcc1bb855efb6860417ed827d3b50feba24a9a8b (patch)
tree47d3c7d6a985dc647f7962329014c8116d657cc9 /tools/idevicesyslog.c
parent3b54aac30447bc02fafd721a63a752968628e7e0 (diff)
downloadlibimobiledevice-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/idevicesyslog.c')
-rw-r--r--tools/idevicesyslog.c13
1 files changed, 8 insertions, 5 deletions
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;