#endif
#include "announce.h"
-#include "util.h"
+#include "timeval.h"
#define AVAHI_ANNOUNCEMENT_JITTER_MSEC 250
#define AVAHI_PROBE_JITTER_MSEC 250
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) {
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);
set_timeout(a, NULL);
next_state(a);
} else {
- GTimeVal tv;
+ struct timeval tv;
avahi_interface_post_probe(a->interface, a->entry->record, FALSE);
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)
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)) {
if (!(a = avahi_get_announcement(s, e, i)))
return FALSE;
+
+/* avahi_log_debug("state: %i", a->state); */
return
a->state == AVAHI_PROBING ||