X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-core%2Fmulticast-lookup.c;h=c3afcb0094e8fd3391ae3ed15e194dfefcb6a9df;hb=78a76e3d5f1d9cc81fd901b8e0263483a7c707d0;hp=d46f94099dc02b8e23aa3bf8def276befba0de82;hpb=b2839754a3d1e15a3009561e69b41608014af0cb;p=catta diff --git a/avahi-core/multicast-lookup.c b/avahi-core/multicast-lookup.c index d46f940..c3afcb0 100644 --- a/avahi-core/multicast-lookup.c +++ b/avahi-core/multicast-lookup.c @@ -23,14 +23,18 @@ #include #endif +#include + #include +#include -#include "server.h" +#include "internal.h" #include "browse.h" #include "socket.h" #include "log.h" #include "hashmap.h" #include "multicast-lookup.h" +#include "rr-util.h" struct AvahiMulticastLookup { AvahiMulticastLookupEngine *engine; @@ -83,7 +87,7 @@ AvahiMulticastLookup *avahi_multicast_lookup_new( void *userdata) { AvahiMulticastLookup *l, *t; - struct timeval ctime; + struct timeval tv; assert(e); assert(AVAHI_IF_VALID(interface)); @@ -109,13 +113,14 @@ AvahiMulticastLookup *avahi_multicast_lookup_new( AVAHI_LLIST_PREPEND(AvahiMulticastLookup, lookups, e->lookups, l); - avahi_querier_add_for_all(e->server, interface, protocol, l->key, &ctime); + avahi_querier_add_for_all(e->server, interface, protocol, l->key, &tv); l->queriers_added = 1; - /* add a second */ - avahi_timeval_add(&ctime, 1000000); + /* Add a second */ + avahi_timeval_add(&tv, 1000000); - l->all_for_now_event = avahi_time_event_new(e->server->time_event_queue, &ctime, all_for_now_callback, l); + /* Issue the ALL_FOR_NOW event one second after the querier was initially created */ + l->all_for_now_event = avahi_time_event_new(e->server->time_event_queue, &tv, all_for_now_callback, l); return l; }