]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
more comments (from commit messages).
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 31 Jul 2018 08:00:57 +0000 (08:00 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 31 Jul 2018 08:00:57 +0000 (08:00 +0000)
git-svn-id: file:///svn/unbound/trunk@4812 be551aaa-1e26-0410-a405-d3ace91eadb9

util/edns.c
util/netevent.c

index deddd0f9b09f065bbf1cc42288f824654bc3e27f..b2c25b602ffe5e65266c9a505db6efc205490cde 100644 (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;
index fac3b8c4f1d12979a9a156b735b99ce5f2c19ba9..641ee755947e8a5323b7175453f9cc491e8ce9af 100644 (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;