diff options
| author | Cy Schubert <cy@FreeBSD.org> | 2022-09-29 14:14:11 +0000 |
|---|---|---|
| committer | Cy Schubert <cy@FreeBSD.org> | 2022-09-29 14:14:11 +0000 |
| commit | 0dde6f4f8e604df8c6fbdab8b4aadb5ddf80c76f (patch) | |
| tree | 83c686c2b95a7045dd0a33836a68de8354ce34cb /services | |
| parent | 9b76d32f2310b735dbeb896cbf2776cad61f23e8 (diff) | |
Diffstat (limited to 'services')
| -rw-r--r-- | services/cache/dns.c | 3 | ||||
| -rw-r--r-- | services/mesh.c | 7 | ||||
| -rw-r--r-- | services/mesh.h | 11 |
3 files changed, 21 insertions, 0 deletions
diff --git a/services/cache/dns.c b/services/cache/dns.c index 6bca8d85fadb..b6e5697349c2 100644 --- a/services/cache/dns.c +++ b/services/cache/dns.c @@ -404,6 +404,9 @@ cache_fill_missing(struct module_env* env, uint16_t qclass, struct ub_packed_rrset_key* akey; time_t now = *env->now; for(ns = dp->nslist; ns; ns = ns->next) { + if(ns->cache_lookup_count > ITERATOR_NAME_CACHELOOKUP_MAX) + continue; + ns->cache_lookup_count++; akey = rrset_cache_lookup(env->rrset_cache, ns->name, ns->namelen, LDNS_RR_TYPE_A, qclass, 0, now, 0); if(akey) { diff --git a/services/mesh.c b/services/mesh.c index 30bcf7cda155..2a411942663d 100644 --- a/services/mesh.c +++ b/services/mesh.c @@ -2240,3 +2240,10 @@ mesh_serve_expired_callback(void* arg) mesh_do_callback(mstate, LDNS_RCODE_NOERROR, msg->rep, c, &tv); } } + +int mesh_jostle_exceeded(struct mesh_area* mesh) +{ + if(mesh->all.count < mesh->max_reply_states) + return 0; + return 1; +} diff --git a/services/mesh.h b/services/mesh.h index 3be9b63faedd..25121a67b3a5 100644 --- a/services/mesh.h +++ b/services/mesh.h @@ -685,4 +685,15 @@ struct dns_msg* mesh_serve_expired_lookup(struct module_qstate* qstate, struct query_info* lookup_qinfo); +/** + * See if the mesh has space for more queries. You can allocate queries + * anyway, but this checks for the allocated space. + * @param mesh: mesh area. + * @return true if the query list is full. + * It checks the number of all queries, not just number of reply states, + * that have a client address. So that spawned queries count too, + * that were created by the iterator, or other modules. + */ +int mesh_jostle_exceeded(struct mesh_area* mesh); + #endif /* SERVICES_MESH_H */ |
