Avoid duplicate concurrent transfer USB API calls
Closed this issue · 0 comments
emaxx-google commented
Currently, every Libusb transfer made by the CCID driver results in a chrome.usb/WebUSB API call.
This is unnecessary and wasteful in some cases, because we might already have equivalent in-flight API calls for the previously canceled transfers. Besides consuming Chrome resources, these extra calls can reportedly lead to hitting the OS kernel limits on the number of active transfers, which completely breaks the USB communication.
Instead, we should enqueue the requests and make sure we only make one JS API call at a time (among all input transfers that read from the same endpoint).