}
/* grab a work request structure for this new request */
- if(worker->env.mesh->num_reply_addrs>worker->request_size*16) {
- /* protect our memory usage from storing reply addresses */
- verbose(VERB_ALGO, "Too many requests queued. "
- "dropping incoming query.");
- worker->env.mesh->stats_dropped++;
- comm_point_drop_reply(repinfo);
- return 0;
- }
mesh_new_client(worker->env.mesh, &qinfo,
ldns_buffer_read_u16_at(c->buffer, 2),
&edns, repinfo, *(uint16_t*)ldns_buffer_begin(c->buffer));
worker_delete(worker);
return 0;
}
- worker->request_size = cfg->num_queries_per_thread;
server_stats_init(&worker->stats, cfg);
alloc_init(&worker->alloc, &worker->daemon->superalloc,
/** timer for statistics */
struct comm_timer* stat_timer;
- /** number of requests that can be handled by this worker */
- size_t request_size;
-
/** random() table for this worker. */
struct ub_randstate* rndstate;
/** do we need to restart or quit (on signal) */
/ (average time for such long queries) qps for long queries.
And about (numqueriesperthread / 2)/(jostletimeout in whole seconds)
qps for short queries, per thread.
+ - Fix the max number of reply-address count to be applied for duplicate
+ queries, and not for new query list entries. This raises the memory
+ usage to a max of (16+1)*numqueriesperthread reply addresses.
25 June 2010: Wouter
- Fix handling of corner case reply from lame server, follows rfc2308.
mesh->stats_dropped ++;
return;
}
+ /* for this new reply state, the reply address is free,
+ * so the limit of reply addresses does not stop reply states*/
+ } else {
+ /* protect our memory usage from storing reply addresses */
+ if(mesh->num_reply_addrs > mesh->max_reply_states*16) {
+ verbose(VERB_ALGO, "Too many requests queued. "
+ "dropping incoming query.");
+ mesh->stats_dropped++;
+ comm_point_drop_reply(rep);
+ return;
+ }
}
/* see if it already exists, if not, create one */
if(!s) {