From 31b8620fa3f4cf804009c5643063d456d87b569185e62982ebdbf1c6429e7929 Mon Sep 17 00:00:00 2001 From: Johannes Meixner Date: Wed, 12 Apr 2017 14:14:55 +0000 Subject: [PATCH] Accepting request 487560 from home:alarrosa:branches:Printing - Add cups-2.1.3-cupsEnumDests-react-to-all-for-now.diff . Avahi sends an ALL_FOR_NOW event when it finishes sending its cache contents. This patch makes cupsEnumDests finish when the signal is received so it doesn't block the caller doing nothing until the timeout finishes (related to bsc#955432, submitted upstream at https://github.com/apple/cups/pull/4989) OBS-URL: https://build.opensuse.org/request/show/487560 OBS-URL: https://build.opensuse.org/package/show/Printing/cups?expand=0&rev=324 --- ....3-cupsEnumDests-react-to-all-for-now.diff | 53 +++++++++++++++++++ cups.changes | 10 ++++ cups.spec | 14 +++-- 3 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 cups-2.1.3-cupsEnumDests-react-to-all-for-now.diff diff --git a/cups-2.1.3-cupsEnumDests-react-to-all-for-now.diff b/cups-2.1.3-cupsEnumDests-react-to-all-for-now.diff new file mode 100644 index 0000000..e394a04 --- /dev/null +++ b/cups-2.1.3-cupsEnumDests-react-to-all-for-now.diff @@ -0,0 +1,53 @@ +Index: cups-2.1.3/cups/dest.c +=================================================================== +--- cups-2.1.3.orig/cups/dest.c ++++ cups-2.1.3/cups/dest.c +@@ -84,6 +84,7 @@ typedef struct _cups_dnssd_data_s /* Enu + AvahiSimplePoll *simple_poll; /* Polling interface */ + AvahiClient *client; /* Client information */ + int got_data; /* Did we get data? */ ++ int remaining_browsers; /* Remaining avahi browsers running */ + # endif /* HAVE_DNSSD */ + cups_dest_cb_t cb; /* Callback */ + void *user_data; /* User data pointer */ +@@ -920,6 +921,7 @@ cupsEnumDests( + data.cb = cb; + data.user_data = user_data; + data.devices = cupsArrayNew3((cups_array_func_t)cups_dnssd_compare_devices, NULL, NULL, 0, NULL, (cups_afree_func_t)cups_dnssd_free_device); ++ data.remaining_browsers = 1; + + # ifdef HAVE_DNSSD + if (DNSServiceCreateConnection(&data.main_ref) != kDNSServiceErr_NoError) +@@ -977,6 +979,7 @@ cupsEnumDests( + ipps_ref = avahi_service_browser_new(data.client, AVAHI_IF_UNSPEC, + AVAHI_PROTO_UNSPEC, "_ipps._tcp", NULL, + 0, cups_dnssd_browse_cb, &data); ++ data.remaining_browsers++; + # endif /* HAVE_SSL */ + # endif /* HAVE_DNSSD */ + +@@ -985,7 +988,7 @@ cupsEnumDests( + else + remaining = msec; + +- while (remaining > 0 && (!cancel || !*cancel)) ++ while (data.remaining_browsers > 0 && remaining > 0 && (!cancel || !*cancel)) + { + /* + * Check for input... +@@ -2762,10 +2765,13 @@ cups_dnssd_browse_cb( + } + break; + +- case AVAHI_BROWSER_REMOVE: + case AVAHI_BROWSER_ALL_FOR_NOW: ++ data->remaining_browsers--; ++ break; ++ ++ case AVAHI_BROWSER_REMOVE: + case AVAHI_BROWSER_CACHE_EXHAUSTED: +- break; ++ break; + } + } + diff --git a/cups.changes b/cups.changes index e4fec56..4ea25b2 100644 --- a/cups.changes +++ b/cups.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Mon Apr 10 17:37:16 UTC 2017 - alarrosa@suse.com + +- Add cups-2.1.3-cupsEnumDests-react-to-all-for-now.diff . + Avahi sends an ALL_FOR_NOW event when it finishes sending + its cache contents. This patch makes cupsEnumDests finish + when the signal is received so it doesn't block the caller + doing nothing until the timeout finishes (related to bsc#955432, + submitted upstream at https://github.com/apple/cups/pull/4989) + ------------------------------------------------------------------- Wed Mar 29 13:41:15 UTC 2017 - kukuk@suse.com diff --git a/cups.spec b/cups.spec index 89b5759..c45400c 100644 --- a/cups.spec +++ b/cups.spec @@ -45,6 +45,8 @@ Patch10: cups-2.1.0-choose-uri-template.patch Patch11: cups-2.1.0-default-webcontent-path.patch # Patch12 cups-2.1.0-cups-systemd-socket.patch Use systemd socket activation properly: Patch12: cups-2.1.0-cups-systemd-socket.patch +# Patch13 cups-2.1.3-cupsEnumDests-react-to-all-for-now.diff bsc#955432 -- React properly to avahi's ALL_FOR_NOW signal to reduce unneeded delay +Patch13: cups-2.1.3-cupsEnumDests-react-to-all-for-now.diff # Patch100...Patch999 is for private patches from SUSE which are not intended for upstream: # Patch100 cups-pam.diff adds conf/pam.suse regarding support for PAM for SUSE: Patch100: cups-pam.diff @@ -133,9 +135,9 @@ browsing". This is now handled by cups-browsed service. %package libs Summary: Libraries for CUPS -# Prerequire /sbin/ldconfig which is used in the traditional bash scriptlets for post/postun: License: GPL-2.0 and LGPL-2.1 Group: Hardware/Printing +# Prerequire /sbin/ldconfig which is used in the traditional bash scriptlets for post/postun: Requires(pre): /sbin/ldconfig %if 0%{?suse_version} >= 1330 Requires(pre): group(lp) @@ -157,6 +159,8 @@ browsing". This is now handled by cups-browsed service. %package client Summary: CUPS Client Programs +License: GPL-2.0 +Group: Hardware/Printing # Require the exact matching version-release of the cups-libs sub-package because # non-matching CUPS libraries may let CUPS software crash (e.g. segfault) # because all CUPS software is built from the one same CUPS source tar ball @@ -166,8 +170,6 @@ Summary: CUPS Client Programs # on the same package repository where the cups package is because # all are built simulaneously from the same cups source package # and all required packages are provided on the same repository: -License: GPL-2.0 -Group: Hardware/Printing Requires: cups-libs = %{version}-%{release} # Conflicts with other print spoolers which provide same binaries like /usr/bin/lp and so on: Conflicts: lprng @@ -190,13 +192,13 @@ browsing". This is now handled by cups-browsed service. %package devel Summary: Development Environment for CUPS +License: GPL-2.0 +Group: Development/Libraries/C and C++ # Do not require the exact matching version-release of cups-libs # but only a cups-libs package with matching version because # for building third-party software which uses only the CUPS public API # there are no CUPS-internal dependencies via CUPS private API calls # (the latter would require the exact matching cups-libs version-release): -License: GPL-2.0 -Group: Development/Libraries/C and C++ Requires: cups-libs = %{version} Requires: glibc-devel @@ -258,6 +260,8 @@ browsing". This is now handled by cups-browsed service. %patch11 -b default-webcontent-path.prig # Patch12 cups-2.1.0-cups-systemd-socket.patch Use systemd socket activation properly: %patch12 -b cups-systemd-socket.orig +# Patch13 cups-2.1.3-cupsEnumDests-react-to-all-for-now.diff React properly to avahi's ALL_FOR_NOW signal to reduce unneeded delay +%patch13 -p1 # Patch100...Patch999 is for private patches from SUSE which are not intended for upstream: # Patch100 cups-pam.diff adds conf/pam.suse regarding support for PAM for SUSE: %patch100