diff options
| author | 2013-02-26 03:20:56 +0100 | |
|---|---|---|
| committer | 2013-02-26 03:20:56 +0100 | |
| commit | fcc1bb855efb6860417ed827d3b50feba24a9a8b (patch) | |
| tree | 47d3c7d6a985dc647f7962329014c8116d657cc9 /tools/idevicesyslog.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/idevicesyslog.c')
| -rw-r--r-- | tools/idevicesyslog.c | 13 |
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[]) | |||
| 49 | idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; | 49 | idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; |
| 50 | int i; | 50 | int i; |
| 51 | const char* udid = NULL; | 51 | const char* udid = NULL; |
| 52 | uint16_t port = 0; | 52 | lockdownd_service_descriptor_t service = NULL; |
| 53 | 53 | ||
| 54 | signal(SIGINT, clean_exit); | 54 | signal(SIGINT, clean_exit); |
| 55 | signal(SIGTERM, clean_exit); | 55 | signal(SIGTERM, clean_exit); |
| @@ -99,13 +99,13 @@ int main(int argc, char *argv[]) | |||
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | /* start syslog_relay service and retrieve port */ | 101 | /* start syslog_relay service and retrieve port */ |
| 102 | ret = lockdownd_start_service(client, "com.apple.syslog_relay", &port); | 102 | ret = lockdownd_start_service(client, "com.apple.syslog_relay", &service); |
| 103 | if ((ret == LOCKDOWN_E_SUCCESS) && port) { | 103 | if ((ret == LOCKDOWN_E_SUCCESS) && service->port) { |
| 104 | lockdownd_client_free(client); | 104 | lockdownd_client_free(client); |
| 105 | 105 | ||
| 106 | /* connect to socket relay messages */ | 106 | /* connect to socket relay messages */ |
| 107 | idevice_connection_t conn = NULL; | 107 | idevice_connection_t conn = NULL; |
| 108 | if ((idevice_connect(device, port, &conn) != IDEVICE_E_SUCCESS) || !conn) { | 108 | if ((idevice_connect(device, service->port, &conn) != IDEVICE_E_SUCCESS) || !conn) { |
| 109 | printf("ERROR: Could not open usbmux connection.\n"); | 109 | printf("ERROR: Could not open usbmux connection.\n"); |
| 110 | } else { | 110 | } else { |
| 111 | while (!quit_flag) { | 111 | while (!quit_flag) { |
| @@ -126,6 +126,9 @@ int main(int argc, char *argv[]) | |||
| 126 | printf("ERROR: Could not start service com.apple.syslog_relay.\n"); | 126 | printf("ERROR: Could not start service com.apple.syslog_relay.\n"); |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | if (service) | ||
| 130 | lockdownd_service_descriptor_free(service); | ||
| 131 | |||
| 129 | idevice_free(device); | 132 | idevice_free(device); |
| 130 | 133 | ||
| 131 | return 0; | 134 | return 0; |
