summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-07-04 23:11:44 +0200
committerGravatar Nikias Bassen2012-07-04 23:11:44 +0200
commit1b4cfb7746eac259d2b555d3abcb20069c9d9834 (patch)
tree4817fca17f9e981a884859c4e5bb00a261e6efd5
parent5e6ffc082b2997ab27892d531e1bf7757f6342d6 (diff)
downloadlibirecovery-1b4cfb7746eac259d2b555d3abcb20069c9d9834.tar.gz
libirecovery-1b4cfb7746eac259d2b555d3abcb20069c9d9834.tar.bz2
irecv_receive: increase timeout and don't break if bytes < BUFFER_SIZE
-rw-r--r--libirecovery.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libirecovery.c b/libirecovery.c
index 745b080..4419b50 100644
--- a/libirecovery.c
+++ b/libirecovery.c
@@ -1059,7 +1059,7 @@ irecv_error_t irecv_receive(irecv_client_t client) {
if (check_context(client) != IRECV_E_SUCCESS) return IRECV_E_NO_DEVICE;
int bytes = 0;
- while (irecv_bulk_transfer(client, 0x81, (unsigned char*) buffer, BUFFER_SIZE, &bytes, 500) == 0) {
+ while (irecv_bulk_transfer(client, 0x81, (unsigned char*) buffer, BUFFER_SIZE, &bytes, 1000) == 0) {
if (bytes > 0) {
if (client->received_callback != NULL) {
irecv_event_t event;
@@ -1070,7 +1070,6 @@ irecv_error_t irecv_receive(irecv_client_t client) {
return IRECV_E_SUCCESS;
}
}
- if (bytes < BUFFER_SIZE) break;
} else break;
}