[Spice-devel] Usb redirection

Hans de Goede hdegoede at redhat.com
Mon Dec 24 04:35:40 PST 2012


On 12/24/2012 04:20 AM, Jackson wrote:
> Thanks, now I can use libusb_handle_events().
> What kind of situation the code will run into
> int usbredirparser_do_write(struct usbredirparser *parser_pub)
> {
> ...
>     if ((parser->flags & usbredirparser_fl_write_cb_owns_buffer) &&
>                  w != wbuf->len)
>              abort();
> ...
> }

If the user of libusbredirparser / libusbredirhost uses the
write_cb_owns_buffer flag *and* then its write function does not
either accept the entire message, or none, but instead accepts
only part of it. Only partially consuming a buffer is not allowed
for users which specify the write_cb_owns_buffer flag, as documented
in the header file.

with spice-gtk the abort() you quoted above should never trigger.



More information about the Spice-devel mailing list