Skip to content
Snippets Groups Projects
Commit e59241a8 authored by Ondřej Surý's avatar Ondřej Surý
Browse files

Merge branch 'rrl_reload_fix' of /git/repositories/knot

parents 8e6bc8ca 844a747a
No related branches found
No related tags found
No related merge requests found
......@@ -619,9 +619,16 @@ int server_conf_hook(const struct conf_t *conf, void *data)
}
if (server->rrl) {
if (rrl_rate(server->rrl) != (uint32_t)conf->rrl) {
/* We cannot free it, threads may use it.
* Setting it to <1 will disable rate limiting. */
if (conf->rrl < 1) {
log_server_info("Rate limiting disabled.\n");
} else {
log_server_info("Rate limiting set to %u "
"responses/sec.\n", conf->rrl);
}
rrl_setrate(server->rrl, conf->rrl);
log_server_info("Rate limiting set to %u responses/sec.\n",
conf->rrl);
} /* At this point, old buckets will converge to new rate. */
}
......
......@@ -216,7 +216,7 @@ int udp_handle(struct answer_ctx *ans, int fd,
}
/* Process RRL. */
if (knot_unlikely(rrl != NULL)) {
if (knot_unlikely(rrl != NULL) && rrl->rate > 0) {
rrl_req_t rrl_rq;
memset(&rrl_rq, 0, sizeof(rrl_req_t));
rrl_rq.w = qbuf; /* Wire */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment