diff options
Diffstat (limited to 'src/property_list_service.c')
| -rw-r--r-- | src/property_list_service.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/property_list_service.c b/src/property_list_service.c index c9a8edf..15adbc8 100644 --- a/src/property_list_service.c +++ b/src/property_list_service.c | |||
| @@ -57,8 +57,7 @@ static property_list_service_error_t idevice_to_property_list_service_error(idev | |||
| 57 | * Creates a new property list service for the specified port. | 57 | * Creates a new property list service for the specified port. |
| 58 | * | 58 | * |
| 59 | * @param device The device to connect to. | 59 | * @param device The device to connect to. |
| 60 | * @param port The port on the device to connect to, usually opened by a call to | 60 | * @param service The service descriptor returned by lockdownd_start_service. |
| 61 | * lockdownd_start_service. | ||
| 62 | * @param client Pointer that will be set to a newly allocated | 61 | * @param client Pointer that will be set to a newly allocated |
| 63 | * property_list_service_client_t upon successful return. | 62 | * property_list_service_client_t upon successful return. |
| 64 | * | 63 | * |
| @@ -66,14 +65,14 @@ static property_list_service_error_t idevice_to_property_list_service_error(idev | |||
| 66 | * PROPERTY_LIST_SERVICE_E_INVALID_ARG when one of the arguments is invalid, | 65 | * PROPERTY_LIST_SERVICE_E_INVALID_ARG when one of the arguments is invalid, |
| 67 | * or PROPERTY_LIST_SERVICE_E_MUX_ERROR when connecting to the device failed. | 66 | * or PROPERTY_LIST_SERVICE_E_MUX_ERROR when connecting to the device failed. |
| 68 | */ | 67 | */ |
| 69 | property_list_service_error_t property_list_service_client_new(idevice_t device, uint16_t port, property_list_service_client_t *client) | 68 | property_list_service_error_t property_list_service_client_new(idevice_t device, lockdownd_service_descriptor_t service, property_list_service_client_t *client) |
| 70 | { | 69 | { |
| 71 | if (!device || port == 0 || !client || *client) | 70 | if (!device || (service->port == 0) || !client || *client) |
| 72 | return PROPERTY_LIST_SERVICE_E_INVALID_ARG; | 71 | return PROPERTY_LIST_SERVICE_E_INVALID_ARG; |
| 73 | 72 | ||
| 74 | /* Attempt connection */ | 73 | /* Attempt connection */ |
| 75 | idevice_connection_t connection = NULL; | 74 | idevice_connection_t connection = NULL; |
| 76 | if (idevice_connect(device, port, &connection) != IDEVICE_E_SUCCESS) { | 75 | if (idevice_connect(device, service->port, &connection) != IDEVICE_E_SUCCESS) { |
| 77 | return PROPERTY_LIST_SERVICE_E_MUX_ERROR; | 76 | return PROPERTY_LIST_SERVICE_E_MUX_ERROR; |
| 78 | } | 77 | } |
| 79 | 78 | ||
| @@ -81,8 +80,12 @@ property_list_service_error_t property_list_service_client_new(idevice_t device, | |||
| 81 | property_list_service_client_t client_loc = (property_list_service_client_t)malloc(sizeof(struct property_list_service_client_private)); | 80 | property_list_service_client_t client_loc = (property_list_service_client_t)malloc(sizeof(struct property_list_service_client_private)); |
| 82 | client_loc->connection = connection; | 81 | client_loc->connection = connection; |
| 83 | 82 | ||
| 84 | *client = client_loc; | 83 | /* enable SSL if requested */ |
| 84 | if (service->ssl_enabled == 1) | ||
| 85 | property_list_service_enable_ssl(client_loc); | ||
| 85 | 86 | ||
| 87 | /* all done, return success */ | ||
| 88 | *client = client_loc; | ||
| 86 | return PROPERTY_LIST_SERVICE_E_SUCCESS; | 89 | return PROPERTY_LIST_SERVICE_E_SUCCESS; |
| 87 | } | 90 | } |
| 88 | 91 | ||
