summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2010-01-12 17:16:14 +0100
committerGravatar Martin Szulecki2010-01-12 17:16:14 +0100
commite7884c40d73e25ee6e6addb3f9d9efc0ffbe068e (patch)
tree870506d6fff3a248351f8fa4b1331fff47279ff6
parent9de537f6963e4e9770ee0aabfeb6982e3d422e69 (diff)
downloadlibimobiledevice-e7884c40d73e25ee6e6addb3f9d9efc0ffbe068e.tar.gz
libimobiledevice-e7884c40d73e25ee6e6addb3f9d9efc0ffbe068e.tar.bz2
Introduce error code for lockdownd requests which require a running session
-rw-r--r--include/libiphone/lockdown.h1
-rw-r--r--src/lockdown.c10
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" {
#define LOCKDOWN_E_MUX_ERROR -12
#define LOCKDOWN_E_ACTIVATION_FAILED -13
#define LOCKDOWN_E_PASSWORD_PROTECTED -14
+#define LOCKDOWN_E_NO_RUNNING_SESSION -15
#define LOCKDOWN_E_UNKNOWN_ERROR -256
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
userpref_get_host_id(&host_id);
if (!host_id)
return LOCKDOWN_E_INVALID_CONF;
- if (!client->ssl_enabled && !lockdownd_start_ssl_session(client, host_id))
- return LOCKDOWN_E_SSL_ERROR;
+ if (!client->session_id)
+ return LOCKDOWN_E_NO_RUNNING_SESSION;
plist_t dict = NULL;
uint32_t port_loc = 0;
@@ -1413,6 +1413,9 @@ lockdownd_error_t lockdownd_activate(lockdownd_client_t client, plist_t activati
if (!client)
return LOCKDOWN_E_INVALID_ARG;
+ if (!client->session_id)
+ return LOCKDOWN_E_NO_RUNNING_SESSION;
+
if (!activation_record)
return LOCKDOWN_E_INVALID_ARG;
@@ -1457,6 +1460,9 @@ lockdownd_error_t lockdownd_deactivate(lockdownd_client_t client)
if (!client)
return LOCKDOWN_E_INVALID_ARG;
+ if (!client->session_id)
+ return LOCKDOWN_E_NO_RUNNING_SESSION;
+
lockdownd_error_t ret = LOCKDOWN_E_UNKNOWN_ERROR;
plist_t dict = plist_new_dict();