darwin: Fix stale descriptor information post reset
authorIdo Yariv <ido@wizery.com>
Wed, 20 May 2020 20:23:11 +0000 (16:23 -0400)
committerChris Dickens <christopher.a.dickens@gmail.com>
Tue, 9 Jun 2020 17:28:41 +0000 (10:28 -0700)
commit0003e606175e344d463a9af73658cab5c01d6286
tree300dcae1071eaba8974f69d7d8562febf65dbf52
parent26611eaa494ed9e077b5b0e1f999f5ae377de958
darwin: Fix stale descriptor information post reset

As part of the recent removal of the backend get_device_descriptor()
function, the darwin backend was modified to update the cached
device_descriptor when a new device is processed. However, this wasn't
done for cases where the device is reused rather than allocated.
This could potentially result in getting stale data when using the
device following a reset.

In addition, when the device is reused, its session ID should be kept
up-to-date in the cached devices list, so it could be found in subsequent
resets.

Closes #733

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/os/darwin_usb.c
libusb/version_nano.h