]> git.meshlink.io Git - catta/blobdiff - avahi-core/response-sched.c
add man page for avahi-daemon.conf
[catta] / avahi-core / response-sched.c
index 1e763e6366cb4beeae9455b60e21e7cad858e810..6d1269e2e97c57299c215d4919ae07cf0e3b1b47 100644 (file)
@@ -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);