summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2009-07-25 18:23:54 +0200
committerGravatar Martin Szulecki2009-07-25 18:23:54 +0200
commit19c9750d670435ce430f0fc85a55faf127bdfbf9 (patch)
tree5d8cd8027fd339b587e322d5b1896878a68cb2f6
parentda94f0ebc7232e8e9d0e629fe559b7bc93d9a1c6 (diff)
downloadlibimobiledevice-19c9750d670435ce430f0fc85a55faf127bdfbf9.tar.gz
libimobiledevice-19c9750d670435ce430f0fc85a55faf127bdfbf9.tar.bz2
Conform to protocol and add session id argument to lockdownd_stop_session()
-rw-r--r--include/libiphone/lockdown.h2
-rw-r--r--src/lockdown.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/include/libiphone/lockdown.h b/include/libiphone/lockdown.h
index daa5800..af58190 100644
--- a/include/libiphone/lockdown.h
+++ b/include/libiphone/lockdown.h
@@ -60,7 +60,7 @@ lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, const char *dom
lockdownd_error_t lockdownd_set_value(lockdownd_client_t client, const char *domain, const char *key, plist_t value);
lockdownd_error_t lockdownd_remove_value(lockdownd_client_t client, const char *domain, const char *key);
lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, const char *service, int *port);
-lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client);
+lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client, const char *session_id);
lockdownd_error_t lockdownd_send(lockdownd_client_t client, plist_t plist);
lockdownd_error_t lockdownd_recv(lockdownd_client_t client, plist_t *plist);
lockdownd_error_t lockdownd_pair(lockdownd_client_t client, char *uuid, char *host_id);
diff --git a/src/lockdown.c b/src/lockdown.c
index 29e5046..bc430c9 100644
--- a/src/lockdown.c
+++ b/src/lockdown.c
@@ -129,7 +129,7 @@ static int lockdown_check_result(plist_t dict, const char *query_match)
*
* @return an error code (LOCKDOWN_E_SUCCESS on success)
*/
-lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client)
+lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client, const char *session_id)
{
if (!client)
return LOCKDOWN_E_INVALID_ARG;
@@ -140,7 +140,7 @@ lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client)
plist_add_sub_key_el(dict, "Request");
plist_add_sub_string_el(dict, "StopSession");
plist_add_sub_key_el(dict, "SessionID");
- plist_add_sub_string_el(dict, client->session_id);
+ plist_add_sub_string_el(dict, session_id);
log_dbg_msg(DBGMASK_LOCKDOWND, "%s: called\n", __func__);
@@ -186,7 +186,7 @@ static lockdownd_error_t lockdownd_stop_ssl_session(lockdownd_client_t client)
if (client->in_SSL) {
log_dbg_msg(DBGMASK_LOCKDOWND, "%s: stopping SSL session\n", __func__);
- ret = lockdownd_stop_session(client);
+ ret = lockdownd_stop_session(client, client->session_id);
log_dbg_msg(DBGMASK_LOCKDOWND, "%s: sending SSL close notify\n", __func__);
gnutls_bye(*client->ssl_session, GNUTLS_SHUT_RDWR);
}