diff options
| author | 2013-02-26 20:07:53 +0100 | |
|---|---|---|
| committer | 2013-02-27 16:18:48 +0100 | |
| commit | a3cdb72ecf938b474174d5fd7cad348ec170dc4b (patch) | |
| tree | 7301e50c95cb6e9e8d8f0422c92226f9b3b088c3 | |
| parent | 1563dc9a26010a3121182f6a33164298c2fe03ab (diff) | |
| download | libimobiledevice-a3cdb72ecf938b474174d5fd7cad348ec170dc4b.tar.gz libimobiledevice-a3cdb72ecf938b474174d5fd7cad348ec170dc4b.tar.bz2 | |
service: Allow passing label for lockdown from start_service helper
| -rw-r--r-- | src/service.c | 6 | ||||
| -rw-r--r-- | src/service.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/service.c b/src/service.c index 09a312b..af37a83 100644 --- a/src/service.c +++ b/src/service.c | |||
| @@ -97,16 +97,18 @@ service_error_t service_client_new(idevice_t device, lockdownd_service_descripto | |||
| 97 | * @param client Pointer that will point to a newly allocated service_client_t | 97 | * @param client Pointer that will point to a newly allocated service_client_t |
| 98 | * upon successful return. Must be freed using service_client_free() after | 98 | * upon successful return. Must be freed using service_client_free() after |
| 99 | * use. | 99 | * use. |
| 100 | * @param label The label to use for communication. Usually the program name. | ||
| 101 | * Pass NULL to disable sending the label in requests to lockdownd. | ||
| 100 | * | 102 | * |
| 101 | * @return SERVICE_E_SUCCESS on success, or a SERVICE_E_* error code | 103 | * @return SERVICE_E_SUCCESS on success, or a SERVICE_E_* error code |
| 102 | * otherwise. | 104 | * otherwise. |
| 103 | */ | 105 | */ |
| 104 | service_error_t service_client_start_service(idevice_t device, const char* service_name, service_client_t *client) | 106 | service_error_t service_client_start_service(idevice_t device, const char* service_name, service_client_t *client, const char* label) |
| 105 | { | 107 | { |
| 106 | *client = NULL; | 108 | *client = NULL; |
| 107 | 109 | ||
| 108 | lockdownd_client_t lckd = NULL; | 110 | lockdownd_client_t lckd = NULL; |
| 109 | if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(device, &lckd, NULL)) { | 111 | if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(device, &lckd, label)) { |
| 110 | debug_info("Could not create a lockdown client."); | 112 | debug_info("Could not create a lockdown client."); |
| 111 | return SERVICE_E_START_SERVICE_ERROR; | 113 | return SERVICE_E_START_SERVICE_ERROR; |
| 112 | } | 114 | } |
diff --git a/src/service.h b/src/service.h index e95d589..982f96a 100644 --- a/src/service.h +++ b/src/service.h | |||
| @@ -42,7 +42,7 @@ typedef int16_t service_error_t; | |||
| 42 | 42 | ||
| 43 | /* creation and destruction */ | 43 | /* creation and destruction */ |
| 44 | service_error_t service_client_new(idevice_t device, lockdownd_service_descriptor_t service, service_client_t *client); | 44 | service_error_t service_client_new(idevice_t device, lockdownd_service_descriptor_t service, service_client_t *client); |
| 45 | service_error_t service_client_start_service(idevice_t device, const char* service_name, service_client_t *client); | 45 | service_error_t service_client_start_service(idevice_t device, const char* service_name, service_client_t *client, const char* label); |
| 46 | service_error_t service_client_free(service_client_t client); | 46 | service_error_t service_client_free(service_client_t client); |
| 47 | 47 | ||
| 48 | /* sending */ | 48 | /* sending */ |
