X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-core%2Ftimeeventq.c;h=a259ba612e06b380a5ffcf466c2d9718901780b6;hb=b6306c88b9279d8194afa85a6497c39531b3bfa9;hp=5e24ba33b4481f8e31cc647d244d88eff56594c8;hpb=769c00f228ba0d37217aaf1424dedde390e7a01c;p=catta diff --git a/avahi-core/timeeventq.c b/avahi-core/timeeventq.c index 5e24ba3..a259ba6 100644 --- a/avahi-core/timeeventq.c +++ b/avahi-core/timeeventq.c @@ -70,14 +70,14 @@ static void update_timeout(AvahiTimeEventQueue *q) { } static void expiration_event(AvahiTimeout *timeout, void *userdata) { - struct timeval now; AvahiTimeEventQueue *q = userdata; AvahiTimeEvent *e; - gettimeofday(&now, NULL); - if ((e = avahi_time_event_queue_root(q))) { + struct timeval now; + gettimeofday(&now, NULL); + /* Check if expired */ if (avahi_timeval_compare(&now, &e->expiry) >= 0) { @@ -88,9 +88,13 @@ static void expiration_event(AvahiTimeout *timeout, void *userdata) { /* Run it */ assert(e->callback); e->callback(e, e->userdata); - } + + update_timeout(q); + return; + } } + avahi_log_debug(__FILE__": Strange, expiration_event() called, but nothing really happened."); update_timeout(q); } @@ -98,6 +102,8 @@ static void fix_expiry_time(AvahiTimeEvent *e) { struct timeval now; assert(e); + return; /*** DO WE REALLY NEED THIS? ***/ + gettimeofday(&now, NULL); if (avahi_timeval_compare(&now, &e->expiry) > 0)