summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2013-08-18 05:23:28 +0200
committerGravatar Martin Szulecki2013-09-17 11:43:33 +0200
commit36e636a727ecbae7083878ceb493b26046a47179 (patch)
tree3707341fff86902d8dba9590ecd3e20406db0c8f /src
parentdf539bdbc7708fb05eea22eec62d6e2f609c10b5 (diff)
downloadlibimobiledevice-36e636a727ecbae7083878ceb493b26046a47179.tar.gz
libimobiledevice-36e636a727ecbae7083878ceb493b26046a47179.tar.bz2
idevice: Add udid attribute to idevice_connection_t for referencing devices
Diffstat (limited to 'src')
-rw-r--r--src/idevice.c6
-rw-r--r--src/idevice.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/idevice.c b/src/idevice.c
index f0d89df..c605da3 100644
--- a/src/idevice.c
+++ b/src/idevice.c
@@ -238,6 +238,7 @@ idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connect
238 new_connection->type = CONNECTION_USBMUXD; 238 new_connection->type = CONNECTION_USBMUXD;
239 new_connection->data = (void*)(long)sfd; 239 new_connection->data = (void*)(long)sfd;
240 new_connection->ssl_data = NULL; 240 new_connection->ssl_data = NULL;
241 idevice_get_udid(device, &new_connection->udid);
241 *connection = new_connection; 242 *connection = new_connection;
242 return IDEVICE_E_SUCCESS; 243 return IDEVICE_E_SUCCESS;
243 } else { 244 } else {
@@ -270,7 +271,12 @@ idevice_error_t idevice_disconnect(idevice_connection_t connection)
270 } else { 271 } else {
271 debug_info("Unknown connection type %d", connection->type); 272 debug_info("Unknown connection type %d", connection->type);
272 } 273 }
274
275 if (connection->udid)
276 free(connection->udid);
277
273 free(connection); 278 free(connection);
279
274 return result; 280 return result;
275} 281}
276 282
diff --git a/src/idevice.h b/src/idevice.h
index 4aeaf33..01b13df 100644
--- a/src/idevice.h
+++ b/src/idevice.h
@@ -58,6 +58,7 @@ struct ssl_data_private {
58typedef struct ssl_data_private *ssl_data_t; 58typedef struct ssl_data_private *ssl_data_t;
59 59
60struct idevice_connection_private { 60struct idevice_connection_private {
61 char *udid;
61 enum connection_type type; 62 enum connection_type type;
62 void *data; 63 void *data;
63 ssl_data_t ssl_data; 64 ssl_data_t ssl_data;