summaryrefslogtreecommitdiffstats
path: root/src/idevice.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/idevice.c')
-rw-r--r--src/idevice.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/idevice.c b/src/idevice.c
index ec426e5..3ed2e9f 100644
--- a/src/idevice.c
+++ b/src/idevice.c
@@ -383,7 +383,15 @@ idevice_error_t idevice_connection_receive_timeout(idevice_connection_t connecti
if (connection->ssl_data) {
#ifdef HAVE_OPENSSL
- int received = SSL_read(connection->ssl_data->session, (void*)data, (int)len);
+ uint32_t received = 0;
+ while (received < len) {
+ int r = SSL_read(connection->ssl_data->session, (void*)((char*)(data+received)), (int)len-received);
+ if (r > 0) {
+ received += r;
+ } else {
+ break;
+ }
+ }
debug_info("SSL_read %d, received %d", len, received);
#else
ssize_t received = gnutls_record_recv(connection->ssl_data->session, (void*)data, (size_t)len);