summaryrefslogtreecommitdiffstats
path: root/libirecovery.c
diff options
context:
space:
mode:
Diffstat (limited to 'libirecovery.c')
-rw-r--r--libirecovery.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libirecovery.c b/libirecovery.c
index aa676a0..b83a8d2 100644
--- a/libirecovery.c
+++ b/libirecovery.c
@@ -923,7 +923,12 @@ irecv_error_t irecv_send_buffer(irecv_client_t client, unsigned char* buffer, un
if (recovery_mode) {
error = irecv_control_transfer(client, 0x41, 0, 0, 0, NULL, 0, USB_TIMEOUT);
} else {
- error = irecv_control_transfer(client, 0x21, 4, 0, 0, NULL, 0, USB_TIMEOUT);
+ char dump[4];
+ if (irecv_control_transfer(client, 0xa1, 5, 0, 0, dump, 1, USB_TIMEOUT) == 1) {
+ error = IRECV_E_SUCCESS;
+ } else {
+ error = IRECV_E_USB_UPLOAD;
+ }
}
if (error != IRECV_E_SUCCESS) {
return error;
@@ -1010,9 +1015,9 @@ irecv_error_t irecv_send_buffer(irecv_client_t client, unsigned char* buffer, un
}
if (dfuNotifyFinished && !recovery_mode) {
- irecv_control_transfer(client, 0x21, 1, 0, 0, (unsigned char*) buffer, 0, USB_TIMEOUT);
+ irecv_control_transfer(client, 0x21, 1, packets, 0, (unsigned char*) buffer, 0, USB_TIMEOUT);
- for (i = 0; i < 3; i++) {
+ for (i = 0; i < 2; i++) {
error = irecv_get_status(client, &status);
if (error != IRECV_E_SUCCESS) {
return error;