core: Correctly report cancellations due to timeouts
authorChris Dickens <christopher.a.dickens@gmail.com>
Mon, 3 Aug 2015 06:26:19 +0000 (23:26 -0700)
committerChris Dickens <christopher.a.dickens@gmail.com>
Wed, 5 Aug 2015 05:53:03 +0000 (22:53 -0700)
commitefd02e7348d9ac769235377b3d7395ecf1fdd0d9
tree14ef7d4d12a54b355044a9a8ef457d65fb314f1c
parent13a90e43acd40e0993790ac354eb7a5a3745a2b2
core: Correctly report cancellations due to timeouts

Prior to this commit, the handle_timeout() function would always
set the USBI_TRANSFER_TIMED_OUT flag on the transfer. However, in
some cases the actual cancellation of the transfer does not succeed,
perhaps because the transfer had just completed. This would cause
occasional false reporting of LIBUSB_TRANSFER_TIMED_OUT when the
transfer did not in fact timeout. This commit adds a check for
successful cancellation before setting the transfer flag.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/io.c
libusb/version_nano.h