diff options
author | Victor Toso <victortoso@redhat.com> | 2021-08-25 19:47:20 +0200 |
---|---|---|
committer | Victor Toso <victortoso@redhat.com> | 2021-11-04 11:18:37 +0100 |
commit | 93ebb381d262db8638f05991df4936a024affcb0 (patch) | |
tree | 48d0fd8a022a5151ff575202ad304d04cc0371ea /usbredirhost | |
parent | 7b0d9d26042054b7a29076804d8d33d75a179cf5 (diff) |
usbredirhost: drop isoc packages
This is similar to the application side callback introduced by
a88e197 "usbredirhost: new callback to drop isoc packets", only that
packages are now dropped when usbredirparser owns and queues the
outgoing data.
Resolves: https://gitlab.freedesktop.org/spice/usbredir/-/issues/19
Signed-off-by: Victor Toso <victortoso@redhat.com>
Diffstat (limited to 'usbredirhost')
-rw-r--r-- | usbredirhost/usbredirhost.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/usbredirhost/usbredirhost.c b/usbredirhost/usbredirhost.c index 34f5b14..03c56e9 100644 --- a/usbredirhost/usbredirhost.c +++ b/usbredirhost/usbredirhost.c @@ -1044,10 +1044,17 @@ static int usbredirhost_can_write_iso_package(struct usbredirhost *host) { uint64_t size; - if (!host->buffered_output_size_func) - return true; + if (host->flags & usbredirhost_fl_write_cb_owns_buffer) { + if (!host->buffered_output_size_func) { + /* Application is not dropping isoc packages */ + return true; + } + size = host->buffered_output_size_func(host->func_priv); + } else { + /* queue is on usbredirparser */ + size = usbredirparser_get_bufferered_output_size(host->parser); + } - size = host->buffered_output_size_func(host->func_priv); if (size >= host->iso_threshold.higher) { if (!host->iso_threshold.dropping) DEBUG("START dropping isoc packets %" PRIu64 " buffer > %" PRIu64 " hi threshold", |