* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: acache.c,v 1.4 2004/12/23 00:13:09 marka Exp $ */
+/* $Id: acache.c,v 1.5 2004/12/29 22:30:10 marka Exp $ */
#include <config.h>
isc_result_totext(result));
return (ISC_R_UNEXPECTED);
};
- /*
- * We need two counters on creation: one for the caller, and one for
- * the cache object.
- */
- isc_refcount_init(&newentry->references, 2);
+
+ isc_refcount_init(&newentry->references, 1);
ISC_LINK_INIT(newentry, link);
ISC_LINK_INIT(newentry, olink);
dbentry_t *odbent;
dbentry_t *rdbent = NULL;
isc_boolean_t close_version = ISC_FALSE;
+ dns_acacheentry_t *dummy_entry = NULL;
REQUIRE(DNS_ACACHE_VALID(acache));
REQUIRE(DNS_ACACHEENTRY_VALID(entry));
if (rdbent != NULL)
ISC_LIST_APPEND(rdbent->referlist, entry, rlink);
+ /*
+ * The additional cache needs an implicit reference to entries in its
+ * link.
+ */
+ dns_acache_attachentry(entry, &dummy_entry);
+
UNLOCK(&entry->lock);
UNLOCK(&acache->lock);