summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2023-05-08 12:32:11 +0200
committerGravatar Nikias Bassen2023-05-08 12:32:11 +0200
commit12ed446fb17b8ea34728641cf4ca836eedab7aeb (patch)
tree7ebb64c24ebca4044646dec2e351fc89ec45b615 /src
parent386c174736e3085745f9249b4a2d83b2e527d62f (diff)
downloadlibirecovery-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')
-rw-r--r--src/libirecovery.c6
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
}
}
+ if (recovery_mode && length % 512 == 0) {
+ /* send a ZLP */
+ bytes = 0;
+ irecv_usb_bulk_transfer(client, 0x04, buffer, 0, &bytes, USB_TIMEOUT);
+ }
+
if (dfu_notify_finished && !recovery_mode) {
irecv_usb_control_transfer(client, 0x21, 1, packets, 0, (unsigned char*) buffer, 0, USB_TIMEOUT);