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) {
1059 if (check_context(client) != IRECV_E_SUCCESS) return IRECV_E_NO_DEVICE; 1059 if (check_context(client) != IRECV_E_SUCCESS) return IRECV_E_NO_DEVICE;
1060 1060
1061 int bytes = 0; 1061 int bytes = 0;
1062 while (irecv_bulk_transfer(client, 0x81, (unsigned char*) buffer, BUFFER_SIZE, &bytes, 500) == 0) { 1062 while (irecv_bulk_transfer(client, 0x81, (unsigned char*) buffer, BUFFER_SIZE, &bytes, 1000) == 0) {
1063 if (bytes > 0) { 1063 if (bytes > 0) {
1064 if (client->received_callback != NULL) { 1064 if (client->received_callback != NULL) {
1065 irecv_event_t event; 1065 irecv_event_t event;
@@ -1070,7 +1070,6 @@ irecv_error_t irecv_receive(irecv_client_t client) {
1070 return IRECV_E_SUCCESS; 1070 return IRECV_E_SUCCESS;
1071 } 1071 }
1072 } 1072 }
1073 if (bytes < BUFFER_SIZE) break;
1074 } else break; 1073 } else break;
1075 } 1074 }
1076 1075