~vcs-imports/nut:timeout-to-750ms-pull-543

Last commit made on 2018-03-17
Get this branch:
git clone -b timeout-to-750ms-pull-543 https://git.launchpad.net/~vcs-imports/nut

Branch merges

Branch information

Name:
timeout-to-750ms-pull-543
Repository:
lp:~vcs-imports/nut

Recent commits

5cea18c... by Steve Gilbert

In HIDGetEvents.c call to get_interrupt, increase timeout from 250 to 750 ms to allow more time for UPS response

e615d08... by Daniele Pezzini <email address hidden>

libusb1: don't use the same var to iterate both devices and interface descriptor

From our old libusb.c, libusb1.c inherited a for loop that iterates over the interface descriptor in order to try and find the HID descriptor among its 'extra' bytes.
Unluckily, it uses the same var (i) that's now used, at the same time, for the iteration through the device list, in which it happens to be nested.
Since this obviously spells disaster, make these vars unique (and add a bit of debugging info).

76388c7... by Daniele Pezzini <email address hidden>

libusb: update example of driver.version.usb and add it to cmdvartab

c97d4c9... by Daniele Pezzini <email address hidden>

libusb1: publish actual libusb version

f60df9b... by Daniele Pezzini <email address hidden>

libusb: in nutscanner, free busname also on nutscan_new_device() errors or when done with it

b28e1e0... by Daniele Pezzini <email address hidden>

libusb: improve handling of errors when allocating new memory

- libusb 0.1 (when not shared with libusb 1.0): prefer our xstrdup() function -- on errors, it'll automatically call fatal*(),
- libusb 1.0 (and nutscanner): don't use our x{malloc,strdup,...}() functions, so that we can free the list of devices (and close the device and call libusb_exit() in nutscanner) before exiting.

dc30233... by Daniele Pezzini <email address hidden>

libusb1: publish the interface we are actually using

d04a9ad... by Daniele Pezzini <email address hidden>

richcomm_usb: use the local USB device handle in usb_device_open()

Although at that point of usb_device_open(), both the local (handle) and the global (udev) device handles point to the same thing, prefer the local one to make things clearer.

2e6be70... by Daniele Pezzini <email address hidden>

libusb: clean up after ourselves

libusb 1.0:
- a device list allocated with libusb_get_device_list() must be deallocated with a call to libusb_free_device_list(),
- ditto for the config descriptor.

libusb 0.1 and 1.0:
- release (commented-out) interfaces when done with them,
- remove unnecessary goto's after calls to fatal*() functions,
- nutscanner: also close the USB device handle (and libusb_exit() for libusb 1.0) on errors.

fb4ef59... by Daniele Pezzini <email address hidden>

usb drivers: free USBDevice_t's dynamically allocated items when cleaning