forked from AristoChen/usb-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Interrupt endpoint threads on interface altsetting change
Proxyied devices that switch between interface altsettings do not work properly in certain cases: the endpoint handling threads might fail to be joined, as they might be blocked on libusb or Raw Gadget transfers. To interrupt Raw Gadget transfers, send the SIGUSR1 signal to the endpoint threads via pthread_kill and add a no-op handler for this signal. To avoid the endpoints threads being blocked forever on libusb sync I/O functions, add a timeout of 1 second for them. As a side-effect, this change makes the proxy print "Operation timed out" messages every second when there's no activity on an endpoint. We can remove them, but I think they might be valuable for getting more visibility into what's happening. Fixes AristoChen#13.
- Loading branch information
Showing
4 changed files
with
46 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters