[Pkg-utopia-commits] r2091 - in /packages/unstable/avahi/debian: changelog patches/80_better_poof.patch

sjoerd at users.alioth.debian.org sjoerd at users.alioth.debian.org
Sat Feb 23 14:23:54 UTC 2008


Author: sjoerd
Date: Sat Feb 23 14:23:53 2008
New Revision: 2091

URL: http://svn.debian.org/wsvn/pkg-utopia/?sc=1&rev=2091
Log:
* debian/patches/80_better_poof.patch:
  - Added. Improve the poof algorithm to prevent false positives when on a
    unreliable network.

Added:
    packages/unstable/avahi/debian/patches/80_better_poof.patch
Modified:
    packages/unstable/avahi/debian/changelog

Modified: packages/unstable/avahi/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/avahi/debian/changelog?rev=2091&op=diff
==============================================================================
--- packages/unstable/avahi/debian/changelog (original)
+++ packages/unstable/avahi/debian/changelog Sat Feb 23 14:23:53 2008
@@ -9,6 +9,11 @@
   * debian/control
     - Bump Standards-Version to 3.7.3. No further changes required.
     - Add dependency on python-glade2 to avahi-discover.
+
+  [ Sjoerd Simons ]
+  * debian/patches/80_better_poof.patch:
+    - Added. Improve the poof algorithm to prevent false positives when on a
+      unreliable network.
 
  -- Sjoerd Simons <sjoerd at debian.org>  Tue, 08 Jan 2008 17:39:50 +0100
 

Added: packages/unstable/avahi/debian/patches/80_better_poof.patch
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/avahi/debian/patches/80_better_poof.patch?rev=2091&op=file
==============================================================================
--- packages/unstable/avahi/debian/patches/80_better_poof.patch (added)
+++ packages/unstable/avahi/debian/patches/80_better_poof.patch Sat Feb 23 14:23:53 2008
@@ -1,0 +1,78 @@
+Index: avahi-core/cache.c
+===================================================================
+--- avahi-core/cache.c	(revision 1745)
++++ avahi-core/cache.c	(working copy)
+@@ -444,12 +444,15 @@
+ 
+ static void* start_poof_callback(AvahiCache *c, AvahiKey *pattern, AvahiCacheEntry *e, void *userdata) {
+     AvahiAddress *a = userdata;
++    struct timeval now;
+ 
+     assert(c);
+     assert(pattern);
+     assert(e);
+     assert(a);
+-    
++
++    gettimeofday(&now, NULL);
++
+     switch (e->state) {
+         case AVAHI_CACHE_VALID:
+ 
+@@ -458,15 +461,23 @@
+ 
+             e->state = AVAHI_CACHE_POOF;
+             e->poof_address = *a;
+-            
++            e->poof_timestamp = now;
++            e->poof_num = 0;
++
+             break;
+ 
+         case AVAHI_CACHE_POOF:
++            if (avahi_timeval_diff(&now, &e->poof_timestamp) < 1000000)
++              break;
+ 
+-            /* This is the second time we got no response, so let's
++            e->poof_timestamp = now;
++            e->poof_address = *a;
++            e->poof_num ++;
++
++            /* This is the 4th time we got no response, so let's
+              * fucking remove this entry. */
+-            
+-            expire_in_one_second(c, e, AVAHI_CACHE_POOF_FINAL);
++            if (e->poof_num > 3)
++              expire_in_one_second(c, e, AVAHI_CACHE_POOF_FINAL);
+             break;
+ 
+         default:
+Index: avahi-core/server.c
+===================================================================
+--- avahi-core/server.c	(revision 1745)
++++ avahi-core/server.c	(working copy)
+@@ -585,7 +585,8 @@
+ 
+         if (!legacy_unicast && !from_local_iface) {
+             reflect_query(s, i, key);
+-            avahi_cache_start_poof(i->cache, key, a);
++            if (!unicast_response)
++              avahi_cache_start_poof(i->cache, key, a);
+         }
+ 
+         if (avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_ANCOUNT) == 0 &&
+Index: avahi-core/cache.h
+===================================================================
+--- avahi-core/cache.h	(revision 1745)
++++ avahi-core/cache.h	(working copy)
+@@ -48,8 +48,10 @@
+     AvahiCache *cache;
+     AvahiRecord *record;
+     struct timeval timestamp;
++    struct timeval poof_timestamp;
+     struct timeval expiry;
+     int cache_flush;
++    int poof_num;
+     
+     AvahiAddress origin;
+ 




More information about the Pkg-utopia-commits mailing list