diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-06-28 20:33:36 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-06-28 20:33:36 +0000 |
commit | f93c4009fd022577c8fe989343172b849e792aa2 (patch) | |
tree | 2d067821813ffa169c014a327694371f924ebfe7 /avahi-core/browse.c | |
parent | 22616538ec2fd1926babb3e6dd60cb6775974252 (diff) |
* cap query interval for continious queries to 1h
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@150 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-core/browse.c')
-rw-r--r-- | avahi-core/browse.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/avahi-core/browse.c b/avahi-core/browse.c index 10d71cb..d9da80c 100644 --- a/avahi-core/browse.c +++ b/avahi-core/browse.c @@ -33,7 +33,6 @@ struct AvahiRecordBrowser { AvahiKey *key; gint interface; guchar protocol; - gint n_query; guint sec_delay; AvahiTimeEvent *time_event; @@ -55,8 +54,10 @@ static void elapse(AvahiTimeEvent *e, void *userdata) { avahi_server_post_query(s->server, s->interface, s->protocol, s->key); - if (s->n_query++ <= 8) - s->sec_delay *= 2; + s->sec_delay *= 2; + + if (s->sec_delay >= 60*60) /* 1h */ + s->sec_delay = 60*60; /* avahi_log_debug("%i. Continuous querying for %s", s->n_query, t = avahi_key_to_string(s->key)); */ /* g_free(t); */ @@ -132,7 +133,6 @@ AvahiRecordBrowser *avahi_record_browser_new(AvahiServer *server, gint interface b->protocol = protocol; b->callback = callback; b->userdata = userdata; - b->n_query = 1; b->sec_delay = 1; avahi_server_post_query(b->server, b->interface, b->protocol, b->key); |