Skip to content

Commit

Permalink
darwin: Don't drop partial data on timeout
Browse files Browse the repository at this point in the history
A timed out transfer might have been partially filled. Propagate
tpriv->size to avoid dropping this data.

Closes #876

Signed-off-by: Nathan Hjelm <hjelmn@cs.unm.edu>
  • Loading branch information
zyp authored and hjelmn committed Feb 16, 2021
1 parent 28a11d1 commit d97e85e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libusb/os/darwin_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2169,7 +2169,7 @@ static int darwin_handle_transfer_completion (struct usbi_transfer *itransfer) {

usbi_dbg ("handling transfer completion type %s with kernel status %d", transfer_types[transfer->type], tpriv->result);

if (kIOReturnSuccess == tpriv->result || kIOReturnUnderrun == tpriv->result) {
if (kIOReturnSuccess == tpriv->result || kIOReturnUnderrun == tpriv->result || kIOUSBTransactionTimeout == tpriv->result) {
if (is_isoc && tpriv->isoc_framelist) {
/* copy isochronous results back */

Expand Down
2 changes: 1 addition & 1 deletion libusb/version_nano.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define LIBUSB_NANO 11605
#define LIBUSB_NANO 11606

0 comments on commit d97e85e

Please sign in to comment.