summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2020-06-06 02:25:02 +0200
committerGravatar Martin Szulecki2020-06-06 02:25:02 +0200
commit2abfb1eb26974a4a7d93c20525ec03941b168da7 (patch)
tree72cf46b6508045cd91f475349925b4626ccc1389 /src
parent4059a8c27fc0dd6a2102809002eedf09dfc9d1f2 (diff)
downloadlibimobiledevice-2abfb1eb26974a4a7d93c20525ec03941b168da7.tar.gz
libimobiledevice-2abfb1eb26974a4a7d93c20525ec03941b168da7.tar.bz2
idevice: Add some newlines for better code readability
Diffstat (limited to 'src')
-rw-r--r--src/idevice.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/idevice.c b/src/idevice.c
index de50a62..74e9d77 100644
--- a/src/idevice.c
+++ b/src/idevice.c
@@ -455,23 +455,30 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_connect(idevice_t device, uint16_t
debug_info("Unsupported address family 0x%02x", ((char*)device->conn_data)[1]);
return IDEVICE_E_UNKNOWN_ERROR;
}
+
char addrtxt[48];
addrtxt[0] = '\0';
+
if (!socket_addr_to_string(saddr, addrtxt, sizeof(addrtxt))) {
debug_info("Failed to convert network address: %d (%s)", errno, strerror(errno));
}
+
debug_info("Connecting to %s port %d...", addrtxt, port);
+
int sfd = socket_connect_addr(saddr, port);
if (sfd < 0) {
debug_info("ERROR: Connecting to network device failed: %d (%s)", errno, strerror(errno));
return IDEVICE_E_NO_DEVICE;
}
+
idevice_connection_t new_connection = (idevice_connection_t)malloc(sizeof(struct idevice_connection_private));
new_connection->type = CONNECTION_NETWORK;
new_connection->data = (void*)(long)sfd;
new_connection->ssl_data = NULL;
new_connection->device = device;
+
*connection = new_connection;
+
return IDEVICE_E_SUCCESS;
} else {
debug_info("Unknown connection type %d", device->conn_type);