extra/cups to 2.3.3op2-3

This commit is contained in:
Kevin Mihelich 2021-04-18 20:31:30 +00:00
parent 058ddaa3a6
commit 190c539c34
2 changed files with 37 additions and 34 deletions

View file

@ -8,7 +8,7 @@ pkgbase="cups"
pkgname=('libcups' 'cups')
#_commit=be75d5d99a54c5f62608f7b9e98748d4c7045ec1 # master 2020-11-27
pkgver=2.3.3op2
pkgrel=2
pkgrel=3
epoch=1
arch=('x86_64')
license=('Apache' 'custom')
@ -43,7 +43,7 @@ sha256sums=('deb3575bbe79c0ae963402787f265bfcf8d804a71fc2c94318a74efec86f96df'
'23349c96f2f7aeb7d48e3bcd35a969f5d5ac8f55a032b0cfaa0a03d7e37ea9af'
'3385047b9ac8a7b13aeb8f0ca55d15f793ce7283516db0155fe28a67923c592d'
'd4537526c1e075866ae22ad263da000fc2a592d36c26b79a459a1cfdade2bb2d'
'2ca30beed3e67314dd44edfb2ada9a89301e4cb058b72e9d2704d130e5f57d1c')
'72a04cb74c4b6240affbc32cf759562cca94efccc213210780b1e7b98f00dfd5')
validpgpkeys=('3737FD0D0E63B30172440D2DDBA3A7AB08D76223') # CUPS.org (CUPS.org PGP key) <security@cups.org>
validpgpkeys+=('45D083946E3035282B3CCA9AF434104235DA97EB') # "CUPS.org <security@cups.org>"
validpgpkeys+=('845464660B686AAB36540B6F999559A027815955') # "Michael R Sweet <michael.r.sweet@gmail.com>"
@ -73,7 +73,7 @@ prepare() {
# FS#56818 - https://github.com/apple/cups/issues/5236
patch -Np1 -i "${srcdir}"/guid.patch
# FS#70382 - https://github.com/OpenPrinting/cups/pull/160
# FS#70382 - https://github.com/OpenPrinting/cups/pull/174
patch -Np1 -i "${srcdir}"/increase_timeout.patch
# Rebuild configure script for not zipping man-pages.

View file

@ -1,28 +1,16 @@
From 1e495c5e8b14d55b9773f864bdf600f5c8ab5317 Mon Sep 17 00:00:00 2001
From c37d71b1a31d26a4790166e2508822b18934a5c0 Mon Sep 17 00:00:00 2001
From: Zdenek Dohnal <zdohnal@redhat.com>
Date: Wed, 24 Mar 2021 13:22:11 +0100
Subject: [PATCH] Some older USB devices (Samsung ML series) are not capable of
sending
Date: Tue, 13 Apr 2021 15:44:14 +0200
Subject: [PATCH 1/2] backend/usb-libusb.c: Use 60s timeout for reading at
backchannel
USB bulks within reading timeout (250ms) when `usb` backend is reading
data from back-channel. The transaction ends with timeout, the whole
job ends garbled and the device prints out 'INTERNAL ERROR - Incomplete
Session by time out'.
This behavior is a regression introduced by commit db53b49265ba, which
simplified the read loop, but put a 250ms timeout instead of the
original 60s in `libusb_bulk_transfer()`.
The timeout used in this PR is tested by two Fedora users
([Samsung ML-2240](https://bugzilla.redhat.com/show_bug.cgi?id=1942326),
[Samsung ML-1665](https://bugzilla.redhat.com/show_bug.cgi?id=1935318))
and works for them.
Some older models malfunction if timeout is too short.
---
backend/usb-libusb.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
backend/usb-libusb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backend/usb-libusb.c b/backend/usb-libusb.c
index d6b0eb423..06e420fbd 100644
index d6b0eb423..fbb0d9d89 100644
--- a/backend/usb-libusb.c
+++ b/backend/usb-libusb.c
@@ -1704,7 +1704,7 @@ static void *read_thread(void *reference)
@ -30,21 +18,36 @@ index d6b0eb423..06e420fbd 100644
g.printer->read_endp,
readbuffer, rbytes,
- &rbytes, 250);
+ &rbytes, 2000);
+ &rbytes, 60000);
if (readstatus == LIBUSB_SUCCESS && rbytes > 0)
{
fprintf(stderr, "DEBUG: Read %d bytes of back-channel data...\n", (int)rbytes);
@@ -1718,11 +1718,11 @@ static void *read_thread(void *reference)
fputs("DEBUG: Got USB return aborted during read.\n", stderr);
/*
- * Make sure this loop executes no more than once every 250 miliseconds...
+ * Make sure this loop executes no more than once every 2 seconds...
From 4cb6f6806cdbe040d478b266a1d351b19341dd79 Mon Sep 17 00:00:00 2001
From: Zdenek Dohnal <zdohnal@redhat.com>
Date: Tue, 13 Apr 2021 15:47:37 +0200
Subject: [PATCH 2/2] backend/usb-libusb.c: Revert enforcing read limits
This commit reverts the change introduced by 2.2.12 [1] - its
implementation caused a regression with Lexmark filters.
[1]
https://github.com/apple/cups/commit/35e927f83529cd9b4bc37bcd418c50e307fced35
---
backend/usb-libusb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/backend/usb-libusb.c b/backend/usb-libusb.c
index fbb0d9d89..89b5182f7 100644
--- a/backend/usb-libusb.c
+++ b/backend/usb-libusb.c
@@ -1721,7 +1721,8 @@ static void *read_thread(void *reference)
* Make sure this loop executes no more than once every 250 miliseconds...
*/
if ((g.wait_eof || !g.read_thread_stop))
- usleep(250000);
+ sleep(2);
- if ((g.wait_eof || !g.read_thread_stop))
+ if ((readstatus != LIBUSB_SUCCESS || rbytes == 0) &&
+ (g.wait_eof || !g.read_thread_stop))
usleep(250000);
}
while (g.wait_eof || !g.read_thread_stop);