]> git.meshlink.io Git - catta/blobdiff - avahi-core/announce.c
* Rename various data structures to prevent a namespace conflict with avahi-core
[catta] / avahi-core / announce.c
index 3374ada69839bb38b185d7e3527b0b9759bf9dd6..3787f8fe18f089cdb0103bdf93e081b8a876a1cb 100644 (file)
@@ -24,7 +24,7 @@
 #endif
 
 #include "announce.h"
-#include "util.h"
+#include "timeval.h"
 
 #define AVAHI_ANNOUNCEMENT_JITTER_MSEC 250
 #define AVAHI_PROBE_JITTER_MSEC 250
@@ -45,7 +45,7 @@ static void remove_announcement(AvahiServer *s, AvahiAnnouncement *a) {
 
 static void elapse_announce(AvahiTimeEvent *e, void *userdata);
 
-static void set_timeout(AvahiAnnouncement *a, const GTimeVal *tv) {
+static void set_timeout(AvahiAnnouncement *a, const struct timeval *tv) {
     g_assert(a);
 
     if (!tv) {
@@ -95,7 +95,7 @@ void avahi_entry_group_check_probed(AvahiEntryGroup *g, gboolean immediately) {
                 a->n_iteration = 1;
                 next_state(a);
             } else {
-                GTimeVal tv;
+                struct timeval tv;
                 a->n_iteration = 0;
                 avahi_elapse_time(&tv, 0, AVAHI_ANNOUNCEMENT_JITTER_MSEC);
                 set_timeout(a, &tv);
@@ -140,7 +140,7 @@ static void next_state(AvahiAnnouncement *a) {
             set_timeout(a, NULL);
             next_state(a);
         } else {
-            GTimeVal tv;
+            struct timeval tv;
 
             avahi_interface_post_probe(a->interface, a->entry->record, FALSE);
             
@@ -158,7 +158,7 @@ static void next_state(AvahiAnnouncement *a) {
         else
             avahi_server_prepare_response(a->server, a->interface, a->entry, FALSE, FALSE);
 
-        avahi_server_generate_response(a->server, a->interface, NULL, NULL, 0, FALSE);
+        avahi_server_generate_response(a->server, a->interface, NULL, NULL, 0, FALSE, FALSE);
 
         if (++a->n_iteration >= 4) {
 /*             gchar *t; */
@@ -171,7 +171,7 @@ static void next_state(AvahiAnnouncement *a) {
 
             set_timeout(a, NULL);
         } else {
-            GTimeVal tv;
+            struct timeval tv;
             avahi_elapse_time(&tv, a->sec_delay*1000, AVAHI_ANNOUNCEMENT_JITTER_MSEC);
         
             if (a->n_iteration < 10)
@@ -204,11 +204,11 @@ AvahiAnnouncement *avahi_get_announcement(AvahiServer *s, AvahiEntry *e, AvahiIn
 
 static void go_to_initial_state(AvahiAnnouncement *a, gboolean immediately) {
     AvahiEntry *e;
-    GTimeVal tv;
+    struct timeval tv;
         
     g_assert(a);
     e = a->entry;
-    
+
     if ((e->flags & AVAHI_ENTRY_UNIQUE) && !(e->flags & AVAHI_ENTRY_NOPROBE))
         a->state = AVAHI_PROBING;
     else if (!(e->flags & AVAHI_ENTRY_NOANNOUNCE)) {
@@ -342,6 +342,8 @@ gboolean avahi_entry_probing(AvahiServer *s, AvahiEntry *e, AvahiInterface *i) {
 
     if (!(a = avahi_get_announcement(s, e, i)))
         return FALSE;
+
+/*     avahi_log_debug("state: %i", a->state); */
     
     return
         a->state == AVAHI_PROBING ||