]> git.meshlink.io Git - catta/blobdiff - avahi-core/browse.c
update examples to make use of avahi_string_list_get_service_cookie() for whatever...
[catta] / avahi-core / browse.c
index 346783d689cf78540ee405d81b4fa724c4124feb..fa97c351b89d04072fb7aa91fb9b42c86c9fb007 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <avahi-common/timeval.h>
 #include <avahi-common/malloc.h>
+#include <avahi-common/error.h>
 
 #include "browse.h"
 #include "log.h"
@@ -125,6 +126,17 @@ static void scan_callback(AvahiTimeEvent *e, void *userdata) {
     }
 }
 
+void avahi_s_record_browser_restart(AvahiSRecordBrowser *b) {
+    assert(b);
+
+    if (!b->scan_time_event) {
+        b->scan_time_event = avahi_time_event_new(b->server->time_event_queue, NULL, scan_callback, b);
+        assert(b->scan_time_event);
+    }
+
+    avahi_server_post_query(b->server, b->interface, b->protocol, b->key);
+}
+
 AvahiSRecordBrowser *avahi_s_record_browser_new(AvahiServer *server, AvahiIfIndex interface, AvahiProtocol protocol, AvahiKey *key, AvahiSRecordBrowserCallback callback, void* userdata) {
     AvahiSRecordBrowser *b, *t;
     struct timeval tv;