]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Fixups.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 20 Jun 2007 13:01:30 +0000 (13:01 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 20 Jun 2007 13:01:30 +0000 (13:01 +0000)
git-svn-id: file:///svn/unbound/trunk@406 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/unbound.c
daemon/worker.c
doc/Changelog
iterator/iterator.c
services/outside_network.c

index a5057f2ef9ff065bcb2cdcda8439782617fbf392..81fc80635de43265231c8036ae926664e609a4de 100644 (file)
@@ -96,7 +96,7 @@ checkrlimits(struct config_file* cfg)
                log_warn("getrlimit: %s", strerror(errno));
                return;
        }
-       if(rlim.rlim_cur == RLIM_INFINITY)
+       if(rlim.rlim_cur == (rlim_t)RLIM_INFINITY)
                return;
        if((size_t)rlim.rlim_cur < total) {
                log_err("Not enough sockets available. Increase "
@@ -113,11 +113,12 @@ checkrlimits(struct config_file* cfg)
 static void
 print_rlim_pretty(const char* str, struct rlimit* rlim)
 {
-       if(rlim->rlim_cur == RLIM_INFINITY && rlim->rlim_max == RLIM_INFINITY)
+       if(rlim->rlim_cur == (rlim_t)RLIM_INFINITY && 
+               rlim->rlim_max == (rlim_t)RLIM_INFINITY)
                log_info("%s unlimited, max unlimited", str);
-       else if(rlim->rlim_max == RLIM_INFINITY)
+       else if(rlim->rlim_max == (rlim_t)RLIM_INFINITY)
                log_info("%s %d, max unlimited", str, (int)rlim->rlim_cur);
-       else if(rlim->rlim_cur == RLIM_INFINITY)
+       else if(rlim->rlim_cur == (rlim_t)RLIM_INFINITY)
                log_info("%s unlimited, max %d", str, (int)rlim->rlim_max);
        else    log_info("%s %d, max %d", str, (int)rlim->rlim_cur, 
                        (int)rlim->rlim_max);
@@ -133,14 +134,15 @@ do_coredump_enable()
                return;
        }
        print_rlim_pretty("rlimit(core) is", &rlim);
-       if(rlim.rlim_cur == RLIM_INFINITY && rlim.rlim_max == RLIM_INFINITY) {
+       if(rlim.rlim_cur == (rlim_t)RLIM_INFINITY && 
+               rlim.rlim_max == (rlim_t)RLIM_INFINITY) {
                return;
        }
-       if(rlim.rlim_cur > 10000) {
+       if(rlim.rlim_cur > (rlim_t)10000) {
                return;
        }
-       rlim.rlim_cur = RLIM_INFINITY;
-       rlim.rlim_max = RLIM_INFINITY;
+       rlim.rlim_cur = (rlim_t)RLIM_INFINITY;
+       rlim.rlim_max = (rlim_t)RLIM_INFINITY;
        if(setrlimit(RLIMIT_CORE, &rlim) < 0) {
                log_warn("setrlimit(core): %s", strerror(errno));
                return;
index 58e2517238acf6fbbaa7712a9d9eab49f8b303e5..8225e3478bc4b035791d7dd43e9cc249c63cd659 100644 (file)
@@ -389,6 +389,7 @@ worker_handle_service_reply(struct comm_point* c, void* arg, int error,
                || LDNS_QDCOUNT(ldns_buffer_begin(c->buffer)) > 1) {
                /* error becomes timeout for the module as if this reply
                 * never arrived. */
+               verbose(VERB_ALGO, "worker: bad reply handled as timeout");
                worker_process_query(worker, w, e->qstate, 
                        module_event_timeout, e);
                return 0;
index 79a8a87dfaaacfa79813a04cc32cd323cba55d9d..cbcb9e6cfa5ef130fb299edca4dc4c6e835b808c 100644 (file)
@@ -3,6 +3,9 @@
        - doc update.
        - fixup CNAME generation by scrubber, and memory allocation of it.
        - fixup deletion of serviced queries when all callbacks delete too.
+       - set num target queries to 0 when you move them to slumber list.
+       - typo in check caused subquery errors to be ignored, fixed.
+       - make lint happy about rlim_t.
 
 19 June 2007: Wouter
        - nicer layout in stats.c, review 0.3 change.
index 0ebdf660dee726a3dcffd2830ae7ea6f3ca2fdf8..0a914cbf4bfb7b7b3c781cbe91e15a9d278aa432 100644 (file)
@@ -1081,6 +1081,7 @@ processQueryTargets(struct module_qstate* qstate, struct iter_qstate* iq,
        /* move other targets to slumber list */
        if(iq->num_target_queries>0) {
                (*qstate->env->remove_subqueries)(qstate);
+               iq->num_target_queries = 0;
        }
 
        /* We have a valid target. */
@@ -1143,7 +1144,9 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
                        return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
                /* close down outstanding requests to be discarded */
                outbound_list_clear(&iq->outlist);
+               iq->num_current_queries = 0;
                (*qstate->env->remove_subqueries)(qstate);
+               iq->num_target_queries = 0;
                return final_state(iq);
        } else if(type == RESPONSE_TYPE_REFERRAL) {
                /* REFERRAL type responses get a reset of the 
@@ -1161,8 +1164,6 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
                if(!iq->dp)
                        return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
                delegpt_log(iq->dp);
-               iq->num_current_queries = 0;
-               iq->num_target_queries = 0;
                /* Count this as a referral. */
                iq->referral_count++;
 
@@ -1171,7 +1172,9 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
                 * handled? Say by a subquery that inherits the outbound_entry.
                 */
                outbound_list_clear(&iq->outlist);
+               iq->num_current_queries = 0;
                (*qstate->env->remove_subqueries)(qstate);
+               iq->num_target_queries = 0;
                verbose(VERB_ALGO, "cleared outbound list for next round");
                return next_state(iq, QUERYTARGETS_STATE);
        } else if(type == RESPONSE_TYPE_CNAME) {
@@ -1201,8 +1204,6 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
                /* Clear the query state, since this is a query restart. */
                iq->deleg_msg = NULL;
                iq->dp = NULL;
-               iq->num_current_queries = 0;
-               iq->num_target_queries = 0;
                /* Note the query restart. */
                iq->query_restart_count++;
 
@@ -1211,7 +1212,9 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
                 * handled? Say by a subquery that inherits the outbound_entry.
                 */
                outbound_list_clear(&iq->outlist);
+               iq->num_current_queries = 0;
                (*qstate->env->remove_subqueries)(qstate);
+               iq->num_target_queries = 0;
                verbose(VERB_ALGO, "cleared outbound list for query restart");
                /* go to INIT_REQUEST_STATE for new qname. */
                return next_state(iq, INIT_REQUEST_STATE);
@@ -1346,6 +1349,7 @@ processTargetResponse(struct module_qstate* qstate, struct iter_qstate* iq,
                /* FIXME: maybe store this nameserver address in the cache
                 * anyways? */
                /* If not, just stop processing this event */
+               verbose(VERB_ALGO, "subq: parent not interested anymore");
                return 0;
        }
 
@@ -1590,12 +1594,15 @@ process_subq_error(struct module_qstate* qstate, struct iter_qstate* iq,
                return;
        }
        /* see if we are still interested in this subquery result */
-       
-       if(!iq->dp)
+       if(iq->dp)
                dpns = delegpt_find_ns(iq->dp, errinf.qname, 
                        errinf.qname_len);
        if(!dpns) {
                /* not interested */
+               verbose(VERB_ALGO, "got subq error, but not interested");
+               log_nametypeclass(VERB_ALGO, "errname", 
+                       errinf.qname, errinf.qtype, errinf.qclass);
+               delegpt_log(iq->dp);
                return;
        }
        dpns->resolved = 1; /* mark as failed */
@@ -1672,6 +1679,7 @@ iter_clear(struct module_qstate* qstate, int id)
        }
        if(iq) {
                outbound_list_clear(&iq->outlist);
+               iq->num_current_queries = 0;
        }
        qstate->minfo[id] = NULL;
 }
index ddd0759b965693c34adf6a90e058cd1c45956aac..ffe975a438a085a56a88a976b85108a0b1cb023f 100644 (file)
@@ -1010,6 +1010,7 @@ serviced_callbacks(struct serviced_query* sq, int error, struct comm_point* c,
                (void)(*p->cb)(c, p->cb_arg, error, rep);
                p = n;
        }
+       log_assert(sq->cblist == NULL);
        serviced_delete(sq);
 }