]> git.meshlink.io Git - catta/blobdiff - avahi-core/cache.c
* Rework some Browsing/Resolving stuff
[catta] / avahi-core / cache.c
index cba9c0b4382ae12576e0bd56ff425f9bdc6c9163..c5e7e319e9bcc6ece613238bf0fc646db57b2bf8 100644 (file)
@@ -50,7 +50,7 @@ static void remove_entry(AvahiCache *c, AvahiCacheEntry *e) {
     if (e->time_event)
         avahi_time_event_queue_remove(c->server->time_event_queue, e->time_event);
 
-    avahi_subscription_notify(c->server, c->interface, e->record, AVAHI_SUBSCRIPTION_REMOVE);
+    avahi_browser_notify(c->server, c->interface, e->record, AVAHI_BROWSER_REMOVE);
 
     avahi_record_unref(e->record);
     
@@ -151,7 +151,7 @@ static void elapse_func(AvahiTimeEvent *t, void *userdata) {
 
     if (e->state == AVAHI_CACHE_FINAL) {
         remove_entry(e->cache, e);
-        g_message("Removing entry from cache due to expiration");
+/*         g_message("Removing entry from cache due to expiration"); */
     } else {
         guint percent = 0;
     
@@ -182,8 +182,8 @@ static void elapse_func(AvahiTimeEvent *t, void *userdata) {
         g_assert(percent > 0);
 
         /* Request a cache update, if we are subscribed to this entry */
-        if (avahi_is_subscribed(e->cache->server, e->record->key)) {
-            g_message("Requesting cache entry update at %i%%.", percent);
+        if (avahi_is_subscribed(e->cache->server, e->cache->interface, e->record->key)) {
+/*             g_message("Requesting cache entry update at %i%%.", percent); */
             avahi_interface_post_query(e->cache->interface, e->record->key, TRUE);
         }
 
@@ -231,13 +231,13 @@ static void expire_in_one_second(AvahiCache *c, AvahiCacheEntry *e) {
 }
 
 void avahi_cache_update(AvahiCache *c, AvahiRecord *r, gboolean unique, const AvahiAddress *a) {
-    gchar *txt;
+/*     gchar *txt; */
     
     g_assert(c);
     g_assert(r && r->ref >= 1);
 
-    g_message("cache update: %s", (txt = avahi_record_to_string(r)));
-    g_free(txt);
+/*     g_message("cache update: %s", (txt = avahi_record_to_string(r))); */
+/*     g_free(txt); */
 
     if (r->ttl == 0) {
         /* This is a goodbye request */
@@ -278,7 +278,7 @@ void avahi_cache_update(AvahiCache *c, AvahiRecord *r, gboolean unique, const Av
     
         if (e) {
             
-            g_message("found matching cache entry"); 
+/*             g_message("found matching cache entry");  */
 
             /* We need to update the hash table key if we replace the
              * record */
@@ -292,7 +292,7 @@ void avahi_cache_update(AvahiCache *c, AvahiRecord *r, gboolean unique, const Av
         } else {
             /* No entry found, therefore we create a new one */
             
-            g_message("couldn't find matching cache entry"); 
+/*             g_message("couldn't find matching cache entry");  */
             
             e = g_new(AvahiCacheEntry, 1);
             e->cache = c;
@@ -307,7 +307,7 @@ void avahi_cache_update(AvahiCache *c, AvahiRecord *r, gboolean unique, const Av
             AVAHI_LLIST_PREPEND(AvahiCacheEntry, entry, c->entries, e);
 
             /* Notify subscribers */
-            avahi_subscription_notify(c->server, c->interface, e->record, AVAHI_SUBSCRIPTION_NEW);
+            avahi_browser_notify(c->server, c->interface, e->record, AVAHI_BROWSER_NEW);
         } 
         
         e->origin = *a;