dcuddeback / libusb-rs

A safe Rust wrapper for libusb.
MIT License
200 stars 65 forks source link

Don't return error on timeout when transferred > 0 #28

Open valff opened 5 years ago

valff commented 5 years ago

Without this fix there is no way to figure out how many bytes transferred if the call interrupted by timeout.

Excerpt from libusb_bulk_transfer documentation:

Returns 0 on success (and populates transferred) LIBUSB_ERROR_TIMEOUT if the transfer timed out (and populates transferred)