avahi: Explicitly handle AVAHI_BROWSER_REMOVE events
authorStefan Brüns <stefan.bruens@rwth-aachen.de>
Sat, 19 Jan 2019 21:41:11 +0000 (22:41 +0100)
committerSebastian Ramacher <sramacher@debian.org>
Thu, 27 Feb 2020 20:44:49 +0000 (20:44 +0000)
name is only set for AVAHI_BROWSER_NEW and AVAHI_BROWSER_REMOVE. Explicitly
check for REMOVE instead of deducing the event type from the name being
set.

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
(cherry picked from commit aaba1daa2683a403ab4adefffa1abd59f9339d2b)
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
Gbp-Pq: Name 0003-avahi-Explicitly-handle-AVAHI_BROWSER_REMOVE-events.patch

modules/services_discovery/avahi.c

index 1457c75a619cd6940b6f5c8dec1cf77755a28846..f1d4d06fe94e066d07d1787ce049d2a895a6b955 100644 (file)
@@ -241,7 +241,7 @@ static void browse_callback(
                      avahi_strerror( avahi_client_errno( p_sys->client ) ) );
         }
     }
-    else if( name )
+    else if( event == AVAHI_BROWSER_REMOVE && name )
     {
         /** \todo Store the input id and search it, rather than searching the items */
         input_item_t *p_item;