]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The dnssd backend did not always report all discovered printers using Avahi
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 19 Feb 2014 20:15:53 +0000 (20:15 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 19 Feb 2014 20:15:53 +0000 (20:15 +0000)
(STR #4365)

Keep track of active browsers, don't stop until Avahi gives up.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11622 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES-1.7.txt
backend/dnssd.c

index 7eb27f29ea322fc09a17b6bc44873dbede6200e8..7378cf7dfa0dffe9523678eae10d6bb4bd87647b 100644 (file)
@@ -5,6 +5,8 @@ CHANGES IN CUPS V1.7.2
 
        - Security: The scheduler now blocks URLs containing embedded HTML
          (STR #4356)
+       - The dnssd backend did not always report all discovered printers using
+         Avahi (STR #4365)
        - The Zebra printer driver did not properly handle negative "label top"
          values (STR #4354)
        - The scheduler did not always update the MakeModel value in
index 44084e3ed8b56b02b8d30a9f206f1ac1bfe1ffbf..bac13b000242c35a02fe635ba60c85b0c75c546d 100644 (file)
@@ -80,6 +80,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 */
 
 
@@ -330,6 +331,7 @@ main(int  argc,                             /* I - Number of command-line args */
     return (1);
   }
 
+  browsers = 6;
   avahi_service_browser_new(client, AVAHI_IF_UNSPEC,
                            AVAHI_PROTO_UNSPEC,
                            "_fax-ipp._tcp", NULL, 0,
@@ -555,7 +557,11 @@ main(int  argc,                            /* I - Number of command-line args */
 
       fprintf(stderr, "DEBUG: sent=%d, count=%d\n", sent, count);
 
+#ifdef HAVE_AVAHI
+      if (sent == cupsArrayCount(devices) && browsers == 0)
+#else
       if (sent == cupsArrayCount(devices))
+#endif /* HAVE_AVAHI */
        break;
     }
   }
@@ -707,9 +713,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;
   }
 }