more comments (from commit messages).

git-svn-id: file:///svn/unbound/trunk@4812 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2018-07-31 08:00:57 +00:00
parent 45e73bcc8e
commit 900cd200a2
2 changed files with 14 additions and 0 deletions

View file

@ -53,6 +53,11 @@ static int edns_keepalive(struct edns_data* edns_out, struct edns_data* edns_in,
if(c->type == comm_udp)
return 1;
/* To respond with a Keepalive option, the client connection
* must have received one message with a TCP Keepalive EDNS option,
* and that option must have 0 length data. Subsequent messages
* sent on that connection will have a TCP Keepalive option.
*/
if(c->tcp_keepalive ||
edns_opt_list_find(edns_in->opt_list, LDNS_EDNS_KEEPALIVE)) {
int keepalive = c->tcp_timeout_msec / 100;

View file

@ -743,6 +743,15 @@ setup_tcp_handler(struct comm_point* c, int fd, int cur, int max)
/* if more than half the tcp handlers are in use, use a shorter
* timeout for this TCP connection, we need to make space for
* other connections to be able to get attention */
/* If > 50% TCP handler structures in use, set timeout to 1/100th
* configured value.
* If > 65%TCP handler structures in use, set to 1/500th configured
* value.
* If > 80% TCP handler structures in use, set to 0.
*
* If the timeout to use falls below 200 milliseconds, an actual
* timeout of 200ms is used.
*/
handler_usage = (cur * 100) / max;
if(handler_usage > 50 && handler_usage <= 65)
c->tcp_timeout_msec /= 100;