[cups/f13/master] Use a smaller buffer when writing to USB devices (bug #617208).

Tim Waugh twaugh at fedoraproject.org
Mon Jan 10 16:31:19 UTC 2011


commit a59a950a1c8272d00ff958a63971e2b7bbe09f6b
Author: Tim Waugh <twaugh at redhat.com>
Date:   Mon Jan 10 15:39:26 2011 +0000

    Use a smaller buffer when writing to USB devices (bug #617208).

 cups-usb-buffer-size.patch |   22 ++++++++++++++++++++++
 cups.spec                  |    4 ++++
 2 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/cups-usb-buffer-size.patch b/cups-usb-buffer-size.patch
new file mode 100644
index 0000000..0f8c1c3
--- /dev/null
+++ b/cups-usb-buffer-size.patch
@@ -0,0 +1,22 @@
+diff -up cups-1.4.6/backend/runloop.c.usb-buffer-size cups-1.4.6/backend/runloop.c
+--- cups-1.4.6/backend/runloop.c.usb-buffer-size	2011-01-10 15:37:56.885677732 +0000
++++ cups-1.4.6/backend/runloop.c	2011-01-10 15:37:59.499623140 +0000
+@@ -45,7 +45,7 @@ backendDrainOutput(int print_fd,	/* I - 
+   fd_set	input;			/* Input set for reading */
+   ssize_t	print_bytes,		/* Print bytes read */
+ 		bytes;			/* Bytes written */
+-  char		print_buffer[8192],	/* Print data buffer */
++  char		print_buffer[512],	/* Print data buffer */
+ 		*print_ptr;		/* Pointer into print data buffer */
+   struct timeval timeout;		/* Timeout for read... */
+ 
+@@ -160,7 +160,7 @@ backendRunLoop(
+ 		bytes;			/* Bytes written */
+   int		paperout;		/* "Paper out" status */
+   int		offline;		/* "Off-line" status */
+-  char		print_buffer[8192],	/* Print data buffer */
++  char		print_buffer[512],	/* Print data buffer */
+ 		*print_ptr,		/* Pointer into print data buffer */
+ 		bc_buffer[1024];	/* Back-channel data buffer */
+   struct timeval timeout;		/* Timeout for select() */
+diff -up cups-1.4.6/backend/usb.c.usb-buffer-size cups-1.4.6/backend/usb.c
diff --git a/cups.spec b/cups.spec
index 904e0f7..fe43086 100644
--- a/cups.spec
+++ b/cups.spec
@@ -67,6 +67,7 @@ Patch36: cups-ricoh-deviceid-oid.patch
 Patch37: cups-texttops-rotate-page.patch
 Patch38: cups-autotype-crash.patch
 Patch39: cups-str3754.patch
+Patch40: cups-usb-buffer-size.patch
 
 Patch100: cups-lspp.patch
 
@@ -276,6 +277,8 @@ module.
 %patch38 -p1 -b .autotype-crash
 # Don't crash when job queued for printer that times out (bug #660604).
 %patch39 -p1 -b .str3754
+# Use a smaller buffer when writing to USB devices (bug #617208).
+%patch40 -p1 -b .usb-buffer-size
 
 %if %lspp
 # LSPP support.
@@ -574,6 +577,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %changelog
 * Mon Jan 10 2011 Tim Waugh <twaugh at redhat.com> 1:1.4.6-2
+- Use a smaller buffer when writing to USB devices (bug #617208).
 - Handle EAI_NONAME when resolving hostnames (bug #617208).
 
 * Fri Jan 07 2011 Jiri Popelka <jpopelka at redhat.com> 1:1.4.6-1


More information about the scm-commits mailing list