+ if (!(q = avahi_hashmap_lookup(i->queriers_by_key, key)))
+ /* This key is currently not subscribed at all, so no cache
+ * refresh is needed */
+ return 0;
+
+ if (q->n_used <= 0) {
+
+ /* If this is an entry nobody references right now, don't
+ * consider it "existing". */
+
+ /* Remove this querier since it is referenced by nobody
+ * and the cached data will soon be out of date */
+ avahi_querier_free(q);
+
+ /* Tell the cache that no refresh is needed */
+ return 0;
+
+ } else {
+ struct timeval tv;
+
+ /* We can defer our query a little, since the cache will now
+ * issue a refresh query anyway. */
+ avahi_elapse_time(&tv, q->sec_delay*1000, 0);
+ avahi_time_event_update(q->time_event, &tv);
+
+ /* Tell the cache that a refresh should be issued */
+ return 1;
+ }