]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
lock the avahi thread before modifying the strings
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Wed, 1 Sep 2021 15:39:32 +0000 (16:39 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Wed, 1 Sep 2021 15:39:32 +0000 (16:39 +0100)
mdns_avahi.c

index c456807877c86c3ca52a8c61e49bb2caa2b29308..959844198f9374646714affc08c9916ea5aa0ad4 100644 (file)
@@ -334,6 +334,7 @@ static int avahi_update(char **txt_records, char **secondary_txt_records) {
   else
     selected_interface = AVAHI_IF_UNSPEC;
 
+  avahi_threaded_poll_lock(tpoll);
   if (txt_records != NULL) {
     if (text_record_string_list)
       avahi_string_list_free(text_record_string_list);
@@ -356,6 +357,8 @@ static int avahi_update(char **txt_records, char **secondary_txt_records) {
     if (err != 0)
       debug(1, "avahi_update error updating secondary txt records.");
   }
+
+  avahi_threaded_poll_unlock(tpoll);
   return 0;
 }