Lines Matching refs:qcache
310 static ares_status_t ares__qcache_insert(ares__qcache_t *qcache,
320 if (qcache == NULL || dnsrec == NULL) {
346 if (ttl > qcache->max_ttl) {
347 ttl = qcache->max_ttl;
368 if (!ares__htable_strvp_insert(qcache->cache, entry->key, entry)) {
372 if (ares__slist_insert(qcache->expire, entry) == NULL) {
380 ares__htable_strvp_remove(qcache->cache, entry->key);
387 static ares_status_t ares__qcache_fetch(ares__qcache_t *qcache,
396 if (qcache == NULL || dnsrec == NULL) {
400 ares__qcache_expire(qcache, now);
408 entry = ares__htable_strvp_get_direct(qcache->cache, key);
429 return ares__qcache_insert(channel->qcache, dnsrec, query->qbuf, query->qlen,
441 if (channel->qcache == NULL) {
450 status = ares__qcache_fetch(channel->qcache, dnsrec, now, abuf, alen);