Skip to content

Interrupt_Transfer not usable #1

Description

@rbredlau

The current implementation of Interrupt_Transfer returns:

if rc != 0 {
    return nil, &libusb_error{rc}
}

return data[:int(transferred)], nil

If libusb can only perform a partial transfer then rc will be -7 (LIBUSB_ERROR_TIMEOUT) but transferred will be a positive integer. The caller to the go implementation will recieve a nil []byte and a timeout error but no indication that anything was transferred.

This makes interrupt I/O practically impossible when the data sent/read is broken up into smaller packets and transferred piece-meal because the caller will never know that anything was sent or read.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions