diff options
author | Hans de Goede <hdegoede@redhat.com> | 2011-08-03 14:41:23 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2011-08-04 14:02:00 +0200 |
commit | 1bf4c03b7c51c37fb4ae2bf52b618e813337f657 (patch) | |
tree | a2f4e6b3ec99fa8d52067825aac84364c5ee2350 /usbredirhost | |
parent | 385c269671c7b992f0f48db07b616ab851cee2c6 (diff) |
usbredirhost: Add usbredirhost_free_write_buffer function
Diffstat (limited to 'usbredirhost')
-rw-r--r-- | usbredirhost/usbredirhost.c | 7 | ||||
-rw-r--r-- | usbredirhost/usbredirhost.h | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/usbredirhost/usbredirhost.c b/usbredirhost/usbredirhost.c index 0fa737f..8266ceb 100644 --- a/usbredirhost/usbredirhost.c +++ b/usbredirhost/usbredirhost.c @@ -542,7 +542,7 @@ void usbredirhost_close(struct usbredirhost *host) usbredirhost_cancel_transfer(host, t); cancelled++; } - + DEBUG("cancelled %d transfers on device close", cancelled); /* On linux libusb_handle_events* handles one completion before returning, so we need to call it once for each cancelled transfer */ @@ -583,6 +583,11 @@ int usbredirhost_write_guest_data(struct usbredirhost *host) return usbredirparser_do_write(host->parser); } +void usbredirhost_free_write_buffer(struct usbredirhost *host, uint8_t *data) +{ + usbredirparser_free_write_buffer(host->parser, data); +} + /**************************************************************************/ static struct usbredirtransfer *usbredirhost_alloc_transfer( diff --git a/usbredirhost/usbredirhost.h b/usbredirhost/usbredirhost.h index 46940ac..6759c94 100644 --- a/usbredirhost/usbredirhost.h +++ b/usbredirhost/usbredirhost.h @@ -89,4 +89,9 @@ int usbredirhost_has_data_to_write(struct usbredirhost *host); on the next call, and will continue doing so until it has succeeded! */ int usbredirhost_write_guest_data(struct usbredirhost *host); +/* When passing the usbredirhost_fl_write_cb_owns_buffer flag to + usbredirhost_open, this function must be called to free the data buffer + passed to write_guest_data_func when done with this buffer. */ +void usbredirhost_free_write_buffer(struct usbredirhost *host, uint8_t *data); + #endif |