diff --git a/cups-avahi-browse.patch b/cups-avahi-browse.patch new file mode 100644 index 0000000..24c05fc --- /dev/null +++ b/cups-avahi-browse.patch @@ -0,0 +1,46 @@ +diff -up cups-1.7.1/backend/dnssd.c.avahi-browse cups-1.7.1/backend/dnssd.c +--- cups-1.7.1/backend/dnssd.c.avahi-browse 2012-12-12 20:54:21.000000000 +0000 ++++ cups-1.7.1/backend/dnssd.c 2014-02-11 12:44:54.785319324 +0000 +@@ -95,6 +95,7 @@ static int job_canceled = 0; + static AvahiSimplePoll *simple_poll = NULL; + /* Poll information */ + static int got_data = 0; /* Got data from poll? */ ++static int browsers = 0; /* Number of running browsers */ + #endif /* HAVE_AVAHI */ + + +@@ -345,6 +346,7 @@ main(int argc, /* I - Number of comm + return (1); + } + ++ browsers = 6; + avahi_service_browser_new(client, AVAHI_IF_UNSPEC, + AVAHI_PROTO_UNSPEC, + "_fax-ipp._tcp", NULL, 0, +@@ -559,7 +561,11 @@ main(int argc, /* I - Number of comm + fprintf(stderr, "DEBUG: sent=%d, count=%d\n", sent, count); + + if (sent == cupsArrayCount(devices)) +- break; ++#ifdef HAVE_AVAHI ++ if (browsers == 0) ++ /* All service browsers have finished */ ++#endif /* HAVE_AVAHI */ ++ break; + } + } + +@@ -710,9 +716,12 @@ browse_callback( + break; + + case AVAHI_BROWSER_REMOVE: +- case AVAHI_BROWSER_ALL_FOR_NOW: + case AVAHI_BROWSER_CACHE_EXHAUSTED: + break; ++ ++ case AVAHI_BROWSER_ALL_FOR_NOW: ++ browsers--; ++ break; + } + } + diff --git a/cups.spec b/cups.spec index 935d7a7..36e42c1 100644 --- a/cups.spec +++ b/cups.spec @@ -69,6 +69,7 @@ Patch38: cups-web-devices-timeout.patch Patch39: cups-final-content-type.patch Patch40: cups-dbus-notifier.patch Patch41: cups-usb-timeout.patch +Patch42: cups-avahi-browse.patch Patch100: cups-lspp.patch @@ -267,6 +268,8 @@ Sends IPP requests to the specified URI and tests and/or displays the results. %patch40 -p1 -b .dbus-notifier # Prevent USB timeouts causing incorrect print output (bug #1026914). %patch41 -p1 -b .usb-timeout +# Prevent dnssd backend exiting too early (bug #1026940, STR #4365). +%patch42 -p1 -b .avahi-browse %if %lspp # LSPP support. @@ -656,6 +659,7 @@ rm -f %{cups_serverbin}/backend/smb %changelog * Tue Mar 11 2014 Tim Waugh - 1:1.6.4-4 +- Prevent dnssd backend exiting too early (bug #1026940, STR #4365). - Use '-f' when using rm in %%setup section. - Prevent USB timeouts causing incorrect print output (bug #1026914).