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 "
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);
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;
/* 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. */
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
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++;
* 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) {
/* 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++;
* 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);
/* 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;
}
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 */
}
if(iq) {
outbound_list_clear(&iq->outlist);
+ iq->num_current_queries = 0;
}
qstate->minfo[id] = NULL;
}