summaryrefslogtreecommitdiffstats
path: root/avahi-core/response-sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'avahi-core/response-sched.c')
-rw-r--r--avahi-core/response-sched.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/avahi-core/response-sched.c b/avahi-core/response-sched.c
index 1e763e6..6d1269e 100644
--- a/avahi-core/response-sched.c
+++ b/avahi-core/response-sched.c
@@ -27,7 +27,7 @@
#include "util.h"
#include "log.h"
-#define AVAHI_RESPONSE_HISTORY_MSEC 700
+#define AVAHI_RESPONSE_HISTORY_MSEC 500
#define AVAHI_RESPONSE_DEFER_MSEC 20
#define AVAHI_RESPONSE_JITTER_MSEC 100
#define AVAHI_RESPONSE_SUPPRESS_MSEC 700
@@ -284,7 +284,9 @@ static AvahiResponseJob* find_history_job(AvahiResponseScheduler *s, AvahiRecord
if (avahi_record_equal_no_ttl(rj->record, record)) {
/* Check whether this entry is outdated */
- if (avahi_age(&rj->delivery) > AVAHI_RESPONSE_HISTORY_MSEC*1000) {
+/* avahi_log_debug("history age: %u", (unsigned) (avahi_age(&rj->delivery)/1000)); */
+
+ if (avahi_age(&rj->delivery)/1000 > AVAHI_RESPONSE_HISTORY_MSEC) {
/* it is outdated, so let's remove it */
job_free(s, rj);
return NULL;
@@ -328,19 +330,24 @@ static AvahiResponseJob* find_suppressed_job(AvahiResponseScheduler *s, AvahiRec
gboolean avahi_response_scheduler_post(AvahiResponseScheduler *s, AvahiRecord *record, gboolean flush_cache, const AvahiAddress *querier, gboolean immediately) {
AvahiResponseJob *rj;
GTimeVal tv;
+/* gchar *t; */
g_assert(s);
g_assert(record);
g_assert(!avahi_key_is_pattern(record->key));
+/* t = avahi_record_to_string(record); */
+/* avahi_log_debug("post %i %s", immediately, t); */
+/* g_free(t); */
+
/* Check whether this response is suppressed */
if (querier &&
(rj = find_suppressed_job(s, record, querier)) &&
avahi_record_is_goodbye(record) == avahi_record_is_goodbye(rj->record) &&
rj->record->ttl >= record->ttl/2) {
-/* avahi_log_debug("Response suppressed by known answer suppression."); */
+/* avahi_log_debug("Response suppressed by known answer suppression."); */
return FALSE;
}
@@ -350,7 +357,7 @@ gboolean avahi_response_scheduler_post(AvahiResponseScheduler *s, AvahiRecord *r
if (avahi_record_is_goodbye(record) == avahi_record_is_goodbye(rj->record) &&
rj->record->ttl >= record->ttl/2 &&
(rj->flush_cache || !flush_cache)) {
-/* avahi_log_debug("Response suppressed by local duplicate suppression (history)"); */
+/* avahi_log_debug("Response suppressed by local duplicate suppression (history)"); */
return FALSE;
}
@@ -361,7 +368,7 @@ gboolean avahi_response_scheduler_post(AvahiResponseScheduler *s, AvahiRecord *r
avahi_elapse_time(&tv, immediately ? 0 : AVAHI_RESPONSE_DEFER_MSEC, immediately ? 0 : AVAHI_RESPONSE_JITTER_MSEC);
if ((rj = find_scheduled_job(s, record))) {
-/* avahi_log_debug("Response suppressed by local duplicate suppression (scheduled)"); */
+/* avahi_log_debug("Response suppressed by local duplicate suppression (scheduled)"); */
/* Update a little ... */
@@ -385,7 +392,7 @@ gboolean avahi_response_scheduler_post(AvahiResponseScheduler *s, AvahiRecord *r
return TRUE;
} else {
-/* avahi_log_debug("Accepted new response job."); */
+/* avahi_log_debug("Accepted new response job."); */
/* Create a new job and schedule it */
rj = job_new(s, record, AVAHI_SCHEDULED);