]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Keep track of number of timeouts. Use this counter to determine if capsforid
authorRalph Dolmans <ralph@nlnetlabs.nl>
Mon, 6 Apr 2020 16:00:06 +0000 (18:00 +0200)
committerRalph Dolmans <ralph@nlnetlabs.nl>
Mon, 6 Apr 2020 16:00:06 +0000 (18:00 +0200)
  fallback should be started.

doc/Changelog
iterator/iterator.c
iterator/iterator.h

index 3e5a93ffa82117c207b13c4d0bfbc6fecc36f5a4..c095c47eb873df4d376b460d1a3be2f466ee644f 100644 (file)
@@ -1,3 +1,7 @@
+6 April 2020: Ralph
+       - Keep track of number of timeouts. Use this counter to determine if
+         capsforid fallback should be started.
+
 6 April 2020: George
        - More documentation for redis-expire-records option.
 
index 1e0113a8740ffd6e2b6d7d5cce93944981776e0b..eea2f2fb23ad3773aca42da235166e1830aeee28 100644 (file)
@@ -159,7 +159,7 @@ iter_new(struct module_qstate* qstate, int id)
        iq->qchase = qstate->qinfo;
        outbound_list_init(&iq->outlist);
        iq->minimise_count = 0;
-       iq->minimise_timeout_count = 0;
+       iq->timeout_count = 0;
        if (qstate->env->cfg->qname_minimisation)
                iq->minimisation_state = INIT_MINIMISE_STATE;
        else
@@ -2190,7 +2190,7 @@ processQueryTargets(struct module_qstate* qstate, struct iter_qstate* iq,
                iq->qinfo_out.qname = iq->qchase.qname;
                iq->qinfo_out.qname_len = iq->qchase.qname_len;
                iq->minimise_count++;
-               iq->minimise_timeout_count = 0;
+               iq->timeout_count = 0;
 
                iter_dec_attempts(iq->dp, 1);
 
@@ -2249,7 +2249,7 @@ processQueryTargets(struct module_qstate* qstate, struct iter_qstate* iq,
                }
        }
        if(iq->minimisation_state == SKIP_MINIMISE_STATE) {
-               if(iq->minimise_timeout_count < MAX_MINIMISE_TIMEOUT_COUNT)
+               if(iq->timeout_count < MAX_MINIMISE_TIMEOUT_COUNT)
                        /* Do not increment qname, continue incrementing next 
                         * iteration */
                        iq->minimisation_state = MINIMISE_STATE;
@@ -2586,14 +2586,15 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
        if(iq->response == NULL) {
                /* Don't increment qname when QNAME minimisation is enabled */
                if(qstate->env->cfg->qname_minimisation) {
-                       iq->minimise_timeout_count++;
                        iq->minimisation_state = SKIP_MINIMISE_STATE;
                }
+               iq->timeout_count++;
                iq->chase_to_rd = 0;
                iq->dnssec_lame_query = 0;
                verbose(VERB_ALGO, "query response was timeout");
                return next_state(iq, QUERYTARGETS_STATE);
        }
+       iq->timeout_count = 0;
        type = response_type_from_server(
                (int)((iq->chase_flags&BIT_RD) || iq->chase_to_rd),
                iq->response, &iq->qinfo_out, iq->dp);
@@ -3599,7 +3600,7 @@ process_response(struct module_qstate* qstate, struct iter_qstate* iq,
        iq->response = NULL;
        iq->state = QUERY_RESP_STATE;
        if(event == module_event_noreply || event == module_event_error) {
-               if(event == module_event_noreply && iq->sent_count >= 3 &&
+               if(event == module_event_noreply && iq->timeout_count >= 3 &&
                        qstate->env->cfg->use_caps_bits_for_id &&
                        !iq->caps_fallback && !is_caps_whitelisted(ie, iq)) {
                        /* start fallback */
index a2f1b5705e7076193098b876d4a5f508d45c34e0..26ff39559f108e053e923619beaae4a89625eef4 100644 (file)
@@ -388,8 +388,9 @@ struct iter_qstate {
 
        /**
         * Count number of time-outs. Used to prevent resolving failures when
-        * the QNAME minimisation QTYPE is blocked. */
-       int minimise_timeout_count;
+        * the QNAME minimisation QTYPE is blocked. Used to determine if
+        * capsforid fallback should be started.*/
+       int timeout_count;
 
        /** True if the current response is from auth_zone */
        int auth_zone_response;