diff options
author | 2023-05-08 12:32:11 +0200 | |
---|---|---|
committer | 2023-05-08 12:32:11 +0200 | |
commit | 12ed446fb17b8ea34728641cf4ca836eedab7aeb (patch) | |
tree | 7ebb64c24ebca4044646dec2e351fc89ec45b615 /src/libirecovery.c | |
parent | 386c174736e3085745f9249b4a2d83b2e527d62f (diff) | |
download | libirecovery-12ed446fb17b8ea34728641cf4ca836eedab7aeb.tar.gz libirecovery-12ed446fb17b8ea34728641cf4ca836eedab7aeb.tar.bz2 |
Send a ZLP in recovery mode if the buffer size is a multiple of 512
Diffstat (limited to 'src/libirecovery.c')
-rw-r--r-- | src/libirecovery.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c index 5b70c08..6741b95 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c | |||
@@ -2868,6 +2868,12 @@ irecv_error_t irecv_send_buffer(irecv_client_t client, unsigned char* buffer, un | |||
2868 | } | 2868 | } |
2869 | } | 2869 | } |
2870 | 2870 | ||
2871 | if (recovery_mode && length % 512 == 0) { | ||
2872 | /* send a ZLP */ | ||
2873 | bytes = 0; | ||
2874 | irecv_usb_bulk_transfer(client, 0x04, buffer, 0, &bytes, USB_TIMEOUT); | ||
2875 | } | ||
2876 | |||
2871 | if (dfu_notify_finished && !recovery_mode) { | 2877 | if (dfu_notify_finished && !recovery_mode) { |
2872 | irecv_usb_control_transfer(client, 0x21, 1, packets, 0, (unsigned char*) buffer, 0, USB_TIMEOUT); | 2878 | irecv_usb_control_transfer(client, 0x21, 1, packets, 0, (unsigned char*) buffer, 0, USB_TIMEOUT); |
2873 | 2879 | ||