diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/idevice.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/idevice.c b/src/idevice.c index 418ee86..7b3625e 100644 --- a/src/idevice.c +++ b/src/idevice.c | |||
| @@ -565,8 +565,24 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_send(idevice_connection_ | |||
| 565 | } | 565 | } |
| 566 | *sent_bytes = sent; | 566 | *sent_bytes = sent; |
| 567 | return IDEVICE_E_SUCCESS; | 567 | return IDEVICE_E_SUCCESS; |
| 568 | } else { | ||
| 569 | uint32_t sent = 0; | ||
| 570 | while (sent < len) { | ||
| 571 | uint32_t bytes = 0; | ||
| 572 | int s = internal_connection_send(connection, data+sent, len-sent, &bytes); | ||
| 573 | if (s < 0) { | ||
| 574 | break; | ||
| 575 | } | ||
| 576 | sent += bytes; | ||
| 577 | } | ||
| 578 | debug_info("internal_connection_send %d, sent %d", len, sent); | ||
| 579 | if (sent < len) { | ||
| 580 | *sent_bytes = 0; | ||
| 581 | return IDEVICE_E_NOT_ENOUGH_DATA; | ||
| 582 | } | ||
| 583 | *sent_bytes = sent; | ||
| 584 | return IDEVICE_E_SUCCESS; | ||
| 568 | } | 585 | } |
| 569 | return internal_connection_send(connection, data, len, sent_bytes); | ||
| 570 | } | 586 | } |
| 571 | 587 | ||
| 572 | static idevice_error_t socket_recv_to_idevice_error(int conn_error, uint32_t len, uint32_t received) | 588 | static idevice_error_t socket_recv_to_idevice_error(int conn_error, uint32_t len, uint32_t received) |
