diff --git a/cups-cpu-hammering.patch b/cups-cpu-hammering.patch new file mode 100644 index 0000000..a23d296 --- /dev/null +++ b/cups-cpu-hammering.patch @@ -0,0 +1,54 @@ +diff -up cups-2.2.0/CHANGES.txt.cpu-hammering cups-2.2.0/CHANGES.txt +diff -up cups-2.2.0/cups/http-addrlist.c.cpu-hammering cups-2.2.0/cups/http-addrlist.c +--- cups-2.2.0/cups/http-addrlist.c.cpu-hammering 2016-09-19 19:56:54.074866957 +0200 ++++ cups-2.2.0/cups/http-addrlist.c 2016-09-21 11:45:22.264775409 +0200 +@@ -304,6 +304,8 @@ httpAddrConnect2( + + if (result > 0) + { ++ http_addrlist_t *connaddr = NULL; ++ + for (i = 0; i < nfds; i ++) + { + # ifdef HAVE_POLL +@@ -314,7 +316,7 @@ httpAddrConnect2( + # endif /* HAVE_POLL */ + { + *sock = fds[i]; +- addrlist = addrs[i]; ++ connaddr = addrs[i]; + + # ifdef DEBUG + len = sizeof(peer); +@@ -322,11 +324,29 @@ httpAddrConnect2( + DEBUG_printf(("1httpAddrConnect2: Connected to %s:%d...", httpAddrString(&peer, temp, sizeof(temp)), httpAddrPort(&peer))); + # endif /* DEBUG */ + } +- else ++# ifdef HAVE_POLL ++ else if (pfds[i].revents & (POLLERR | POLLHUP)) ++# else ++ else if (FD_SET(fds[i], &error)) ++# endif /* HAVE_POLL */ ++ { ++ /* ++ * Error on socket, remove from the "pool"... ++ */ ++ + httpAddrClose(NULL, fds[i]); ++ nfds --; ++ if (i < nfds) ++ { ++ memmove(fds + i, fds + i + 1, (size_t)(nfds - i) * (sizeof(fds[0]))); ++ memmove(addrs + i, addrs + i + 1, (size_t)(nfds - i) * (sizeof(addrs[0]))); ++ } ++ i --; ++ } + } + +- return (addrlist); ++ if (connaddr) ++ return (connaddr); + } + #endif /* O_NONBLOCK */ + diff --git a/cups.spec b/cups.spec index bfff1d2..57ee425 100644 --- a/cups.spec +++ b/cups.spec @@ -15,7 +15,7 @@ Summary: CUPS printing system Name: cups Epoch: 1 Version: 2.2.0 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 Url: http://www.cups.org/ Source0: https://github.com/apple/cups/releases/download/v%{VERSION}/cups-%{VERSION}-source.tar.gz @@ -62,6 +62,7 @@ Patch34: cups-avahi-no-threaded.patch Patch35: cups-ipp-multifile.patch Patch36: cups-web-devices-timeout.patch Patch37: cups-synconclose.patch +Patch38: cups-cpu-hammering.patch Patch100: cups-lspp.patch @@ -255,6 +256,8 @@ Sends IPP requests to the specified URI and tests and/or displays the results. %patch36 -p1 -b .web-devices-timeout # Set the default for SyncOnClose to Yes. %patch37 -p1 -b .synconclose +# fixing looping in partial failing service (bug #1366775) +%patch38 -p1 -b .cpu-hammering %if %{lspp} # LSPP support. @@ -617,6 +620,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man5/ipptoolfile.5.gz %changelog +* Thu Sep 22 2016 Zdenek Dohnal - 1:2.2.0-2 +- fixing looping in partial failing service (bug #1366775) + * Thu Sep 15 2016 Jiri Popelka - 1:2.2.0-1 - 2.2.0