diff options
| author | 2015-10-21 00:39:14 -0700 | |
|---|---|---|
| committer | 2015-10-21 13:23:22 +0200 | |
| commit | 6070126868069f2ee01ea9414f4cfbe5de285267 (patch) | |
| tree | f4a2fcc432a4d307308e9de2630ba455f82694b7 /src | |
| parent | 40f7dd06496d5b1c8963f760a10a217df926cd85 (diff) | |
| download | libimobiledevice-6070126868069f2ee01ea9414f4cfbe5de285267.tar.gz libimobiledevice-6070126868069f2ee01ea9414f4cfbe5de285267.tar.bz2 | |
Fix installation_proxy when using GnuTLS instead of OpenSSL
Diffstat (limited to 'src')
| -rw-r--r-- | src/idevice.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/idevice.c b/src/idevice.c index 7c33cdd..b776e84 100644 --- a/src/idevice.c +++ b/src/idevice.c | |||
| @@ -393,10 +393,13 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_receive_timeout(idevice_ | |||
| 393 | } | 393 | } |
| 394 | 394 | ||
| 395 | if (connection->ssl_data) { | 395 | if (connection->ssl_data) { |
| 396 | #ifdef HAVE_OPENSSL | ||
| 397 | uint32_t received = 0; | 396 | uint32_t received = 0; |
| 398 | while (received < len) { | 397 | while (received < len) { |
| 398 | #ifdef HAVE_OPENSSL | ||
| 399 | int r = SSL_read(connection->ssl_data->session, (void*)((char*)(data+received)), (int)len-received); | 399 | int r = SSL_read(connection->ssl_data->session, (void*)((char*)(data+received)), (int)len-received); |
| 400 | #else | ||
| 401 | ssize_t r = gnutls_record_recv(connection->ssl_data->session, (void*)(data+received), (size_t)len-received); | ||
| 402 | #endif | ||
| 400 | if (r > 0) { | 403 | if (r > 0) { |
| 401 | received += r; | 404 | received += r; |
| 402 | } else { | 405 | } else { |
| @@ -404,9 +407,6 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_receive_timeout(idevice_ | |||
| 404 | } | 407 | } |
| 405 | } | 408 | } |
| 406 | debug_info("SSL_read %d, received %d", len, received); | 409 | debug_info("SSL_read %d, received %d", len, received); |
| 407 | #else | ||
| 408 | ssize_t received = gnutls_record_recv(connection->ssl_data->session, (void*)data, (size_t)len); | ||
| 409 | #endif | ||
| 410 | if (received > 0) { | 410 | if (received > 0) { |
| 411 | *recv_bytes = received; | 411 | *recv_bytes = received; |
| 412 | return IDEVICE_E_SUCCESS; | 412 | return IDEVICE_E_SUCCESS; |
