Prior to this commit, a transfer that was submitted with a non-zero
timeout would retain this timeout if the transfer was resubmitted with
a zero (unlimited) timeout. This commit corrects this by clearing the
transfer's timeout if the desired timeout is zero.
Closes #332
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
unsigned int timeout =
USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)->timeout;
- if (!timeout)
+ if (!timeout) {
+ timerclear(&transfer->timeout);
return 0;
+ }
r = usbi_backend.clock_gettime(USBI_CLOCK_MONOTONIC, ¤t_time);
if (r < 0) {