diff options
author | 2010-07-21 16:35:51 +0200 | |
---|---|---|
committer | 2010-07-21 16:35:51 +0200 | |
commit | 6ab686bd4bfa1459d67fa108697f0bac1f4d67ad (patch) | |
tree | 308e51bb2048dc6017c4194e9e9607600b0ad6d2 | |
parent | cf463744d84c55ba8e256ca89caf866fe1beb857 (diff) | |
download | libirecovery-6ab686bd4bfa1459d67fa108697f0bac1f4d67ad.tar.gz libirecovery-6ab686bd4bfa1459d67fa108697f0bac1f4d67ad.tar.bz2 |
irecovery: Only request data on initial connect, not after every command
This prevents possibly obsolete usb traffic. It appears requesting data
after every command is also no longer needed due to the new event handling
code.
-rw-r--r-- | src/irecovery.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/irecovery.c b/src/irecovery.c index 327527b..da5812d 100644 --- a/src/irecovery.c +++ b/src/irecovery.c @@ -104,13 +104,13 @@ void init_shell(irecv_client_t client) { irecv_event_subscribe(client, IRECV_RECEIVED, &received_cb, NULL); irecv_event_subscribe(client, IRECV_PRECOMMAND, &precommand_cb, NULL); irecv_event_subscribe(client, IRECV_POSTCOMMAND, &postcommand_cb, NULL); - while (!quit) { - error = irecv_receive(client); - if (error != IRECV_E_SUCCESS) { - debug("%s\n", irecv_strerror(error)); - break; - } + error = irecv_receive(client); + if (error != IRECV_E_SUCCESS) { + debug("%s\n", irecv_strerror(error)); + } + + while (!quit) { char* cmd = readline("> "); if (cmd && *cmd) { error = irecv_send_command(client, cmd); |