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
This commit is contained in:
Johannes Meixner 2017-04-12 14:14:55 +00:00 committed by Git OBS Bridge
parent 47dbebda3e
commit 31b8620fa3
3 changed files with 72 additions and 5 deletions

View File

@ -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;
}
}

View File

@ -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

View File

@ -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