diff options
author | Nikias Bassen | 2023-05-08 12:32:11 +0200 |
---|---|---|
committer | Nikias Bassen | 2023-05-08 12:32:11 +0200 |
commit | 12ed446fb17b8ea34728641cf4ca836eedab7aeb (patch) | |
tree | 7ebb64c24ebca4044646dec2e351fc89ec45b615 | |
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
-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 } } + 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); |