Skip to content

Commit

Permalink
Enforce USB read limits (Issue #5583)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael R Sweet committed May 17, 2019
1 parent a0096a2 commit 35e927f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CHANGES - 2.2.12 - 2019-05-15
CHANGES - 2.2.12 - 2019-05-17
=============================


Expand All @@ -17,6 +17,8 @@ Changes in CUPS v2.2.12
- Timed out job submission now yields an error (Issue #5570)
- The footer in the web interface covered some content on small displays
(Issue #5574)
- The libusb-based USB backend now enforces read limits, improving print speed
in many cases (Issue #5583)


Changes in CUPS v2.2.11
Expand Down
5 changes: 2 additions & 3 deletions backend/usb-libusb.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* LIBUSB interface code for CUPS.
*
* Copyright 2007-2015 by Apple Inc.
* Copyright 2007-2019 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
Expand Down Expand Up @@ -1746,8 +1746,7 @@ static void *read_thread(void *reference)
* Make sure this loop executes no more than once every 250 miliseconds...
*/

if ((readstatus != LIBUSB_SUCCESS || rbytes == 0) &&
(g.wait_eof || !g.read_thread_stop))
if ((g.wait_eof || !g.read_thread_stop))
{
gettimeofday(&now, NULL);
if (timercmp(&now, &end, <))
Expand Down

0 comments on commit 35e927f

Please sign in to comment.