diff options
| author | 2010-01-12 17:16:14 +0100 | |
|---|---|---|
| committer | 2010-01-12 17:16:14 +0100 | |
| commit | e7884c40d73e25ee6e6addb3f9d9efc0ffbe068e (patch) | |
| tree | 870506d6fff3a248351f8fa4b1331fff47279ff6 | |
| parent | 9de537f6963e4e9770ee0aabfeb6982e3d422e69 (diff) | |
| download | libimobiledevice-e7884c40d73e25ee6e6addb3f9d9efc0ffbe068e.tar.gz libimobiledevice-e7884c40d73e25ee6e6addb3f9d9efc0ffbe068e.tar.bz2 | |
Introduce error code for lockdownd requests which require a running session
| -rw-r--r-- | include/libiphone/lockdown.h | 1 | ||||
| -rw-r--r-- | src/lockdown.c | 10 |
2 files changed, 9 insertions, 2 deletions
diff --git a/include/libiphone/lockdown.h b/include/libiphone/lockdown.h index 08431aa..e134f5f 100644 --- a/include/libiphone/lockdown.h +++ b/include/libiphone/lockdown.h | |||
| @@ -46,6 +46,7 @@ extern "C" { | |||
| 46 | #define LOCKDOWN_E_MUX_ERROR -12 | 46 | #define LOCKDOWN_E_MUX_ERROR -12 |
| 47 | #define LOCKDOWN_E_ACTIVATION_FAILED -13 | 47 | #define LOCKDOWN_E_ACTIVATION_FAILED -13 |
| 48 | #define LOCKDOWN_E_PASSWORD_PROTECTED -14 | 48 | #define LOCKDOWN_E_PASSWORD_PROTECTED -14 |
| 49 | #define LOCKDOWN_E_NO_RUNNING_SESSION -15 | ||
| 49 | 50 | ||
| 50 | #define LOCKDOWN_E_UNKNOWN_ERROR -256 | 51 | #define LOCKDOWN_E_UNKNOWN_ERROR -256 |
| 51 | 52 | ||
diff --git a/src/lockdown.c b/src/lockdown.c index 69ccf34..11b4fe6 100644 --- a/src/lockdown.c +++ b/src/lockdown.c | |||
| @@ -1341,8 +1341,8 @@ lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, const char | |||
| 1341 | userpref_get_host_id(&host_id); | 1341 | userpref_get_host_id(&host_id); |
| 1342 | if (!host_id) | 1342 | if (!host_id) |
| 1343 | return LOCKDOWN_E_INVALID_CONF; | 1343 | return LOCKDOWN_E_INVALID_CONF; |
| 1344 | if (!client->ssl_enabled && !lockdownd_start_ssl_session(client, host_id)) | 1344 | if (!client->session_id) |
| 1345 | return LOCKDOWN_E_SSL_ERROR; | 1345 | return LOCKDOWN_E_NO_RUNNING_SESSION; |
| 1346 | 1346 | ||
| 1347 | plist_t dict = NULL; | 1347 | plist_t dict = NULL; |
| 1348 | uint32_t port_loc = 0; | 1348 | uint32_t port_loc = 0; |
| @@ -1413,6 +1413,9 @@ lockdownd_error_t lockdownd_activate(lockdownd_client_t client, plist_t activati | |||
| 1413 | if (!client) | 1413 | if (!client) |
| 1414 | return LOCKDOWN_E_INVALID_ARG; | 1414 | return LOCKDOWN_E_INVALID_ARG; |
| 1415 | 1415 | ||
| 1416 | if (!client->session_id) | ||
| 1417 | return LOCKDOWN_E_NO_RUNNING_SESSION; | ||
| 1418 | |||
| 1416 | if (!activation_record) | 1419 | if (!activation_record) |
| 1417 | return LOCKDOWN_E_INVALID_ARG; | 1420 | return LOCKDOWN_E_INVALID_ARG; |
| 1418 | 1421 | ||
| @@ -1457,6 +1460,9 @@ lockdownd_error_t lockdownd_deactivate(lockdownd_client_t client) | |||
| 1457 | if (!client) | 1460 | if (!client) |
| 1458 | return LOCKDOWN_E_INVALID_ARG; | 1461 | return LOCKDOWN_E_INVALID_ARG; |
| 1459 | 1462 | ||
| 1463 | if (!client->session_id) | ||
| 1464 | return LOCKDOWN_E_NO_RUNNING_SESSION; | ||
| 1465 | |||
| 1460 | lockdownd_error_t ret = LOCKDOWN_E_UNKNOWN_ERROR; | 1466 | lockdownd_error_t ret = LOCKDOWN_E_UNKNOWN_ERROR; |
| 1461 | 1467 | ||
| 1462 | plist_t dict = plist_new_dict(); | 1468 | plist_t dict = plist_new_dict(); |
