[arch-commits] Commit in cups/trunk (PKGBUILD cups-busy-loop.patch)

Andreas Radke andyrtr at archlinux.org
Sat Mar 21 08:48:47 UTC 2015


    Date: Saturday, March 21, 2015 @ 09:48:46
  Author: andyrtr
Revision: 234432

upgpkg: cups 2.0.2-3

avoid busy loop - apply Fedora fix - should cover FS#42666

Added:
  cups/trunk/cups-busy-loop.patch
Modified:
  cups/trunk/PKGBUILD

----------------------+
 PKGBUILD             |   13 ++++++-------
 cups-busy-loop.patch |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 7 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2015-03-21 08:29:33 UTC (rev 234431)
+++ PKGBUILD	2015-03-21 08:48:46 UTC (rev 234432)
@@ -4,7 +4,7 @@
 pkgbase="cups"
 pkgname=('libcups' 'cups')
 pkgver=2.0.2
-pkgrel=2
+pkgrel=3
 arch=('i686' 'x86_64')
 license=('GPL')
 url="http://www.cups.org/"
@@ -20,7 +20,7 @@
         cups-1.6.2-statedir.patch
         cups-1.6.0-fix-install-perms.patch
         # bugfixes
-        )
+        cups-busy-loop.patch)
 md5sums=('6e0ea72dbafcf5baaa1cf4178e71096d'
          'SKIP'
          'fc8286f185e2cc5f7e1f6843bf193e2b'
@@ -29,7 +29,8 @@
          '1beb4896f217bc241bc08a422274ec0c'
          '90c30380d4c8cd48a908cfdadae1ea24'
          '451609db34f95209d64c38474de27ce1'
-         '5117f65342fcc69c6a506529e4daca9e')
+         '5117f65342fcc69c6a506529e4daca9e'
+         '68c70bda07ccb8caaa7a2df485a16092')
 validpgpkeys=('3737FD0D0E63B30172440D2DDBA3A7AB08D76223') # CUPS.org (CUPS.org PGP key) <security at cups.org>
 
 prepare() {
@@ -49,6 +50,8 @@
   patch -Np0 -i ${srcdir}/cups-1.6.0-fix-install-perms.patch
 
   # bug fixes 
+  # Avoid busy loop in cupsd when connection is closed after request Fedora ##1179596 - may solve FS#42666
+  patch -Np1 -i ${srcdir}/cups-busy-loop.patch
   
   # set MaxLogSize to 0 to prevent using cups internal log rotation
   sed -i -e '5i\ ' conf/cupsd.conf.in
@@ -80,10 +83,6 @@
      --enable-libpaper \
      --with-php=/usr/bin/php-cgi \
      --with-optim="$CFLAGS" #--help
-
-  # Avoid epoll for the moment (Fedora bug #1179596 - may solve FS#42666)
-  sed -i -e 's,\(HAVE_EPOLL\) 1,\1 0,' config.h
-
   make
 }
 

Added: cups-busy-loop.patch
===================================================================
--- cups-busy-loop.patch	                        (rev 0)
+++ cups-busy-loop.patch	2015-03-21 08:48:46 UTC (rev 234432)
@@ -0,0 +1,35 @@
+diff -up cups-2.0.2/scheduler/client.c.busy-loop cups-2.0.2/scheduler/client.c
+--- cups-2.0.2/scheduler/client.c.busy-loop	2014-08-28 16:37:22.000000000 +0100
++++ cups-2.0.2/scheduler/client.c	2015-03-16 17:24:32.506232983 +0000
+@@ -585,6 +585,17 @@ cupsdReadClient(cupsd_client_t *con)	/*
+     * connection and we need to shut it down...
+     */
+ 
++    if (!httpGetReady(con->http) && recv(httpGetFd(con->http), buf, 1, MSG_PEEK) < 1)
++    {
++     /*
++      * Connection closed...
++      */
++
++      cupsdLogClient(con, CUPSD_LOG_DEBUG, "Closing on EOF.");
++      cupsdCloseClient(con);
++      return;
++    }
++
+     cupsdLogClient(con, CUPSD_LOG_DEBUG, "Closing on unexpected HTTP read state %s.",
+ 		   httpStateString(httpGetState(con->http)));
+     cupsdCloseClient(con);
+@@ -1979,12 +1990,6 @@ cupsdReadClient(cupsd_client_t *con)	/*
+ 
+ 	if (httpGetState(con->http) == HTTP_STATE_POST_SEND)
+ 	{
+-	 /*
+-	  * Don't listen for activity until we decide to do something with this...
+-	  */
+-
+-          cupsdAddSelect(httpGetFd(con->http), NULL, NULL, con);
+-
+ 	  if (con->file >= 0)
+ 	  {
+ 	    fstat(con->file, &filestats);
+



More information about the arch-commits mailing list