summaryrefslogtreecommitdiffstats
path: root/src/lockdown.c
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 /src/lockdown.c
parent9de537f6963e4e9770ee0aabfeb6982e3d422e69 (diff)
downloadlibimobiledevice-e7884c40d73e25ee6e6addb3f9d9efc0ffbe068e.tar.gz
libimobiledevice-e7884c40d73e25ee6e6addb3f9d9efc0ffbe068e.tar.bz2
Introduce error code for lockdownd requests which require a running session
Diffstat (limited to 'src/lockdown.c')
-rw-r--r--src/lockdown.c10
1 files changed, 8 insertions, 2 deletions
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();