diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-08-15 16:07:29 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-08-15 16:07:29 +0000 |
commit | 7ada090e70d25937d27b2e93b0dab4d9d68c5d23 (patch) | |
tree | 6d1da099d6b621b442e7a775783c752be182b186 /avahi-core/timeeventq.c | |
parent | fe367caf27dd022258218a768da1ae2ddd246203 (diff) |
* fix a bad memory access bug in avahi_strndup()
* some small optimizations to call gettimeofday() less often
* fix dbus-watch-glue to call dbus_connection_dispatch()
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@333 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-core/timeeventq.c')
-rw-r--r-- | avahi-core/timeeventq.c | 14 |
1 files changed, 10 insertions, 4 deletions
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) |