Lines Matching defs:qstate
313 mesh_serve_expired_lookup(struct module_qstate* qstate,
321 time_t timenow = *qstate->env->now;
322 int must_validate = (!(qstate->query_flags&BIT_CD)
323 || qstate->env->cfg->ignore_cd) && qstate->env->need_to_validate;
326 h = query_info_hash(lookup_qinfo, qstate->query_flags);
327 e = slabhash_lookup(qstate->env->msg_cache, h, lookup_qinfo, 0);
333 msg = tomsg(qstate->env, &key->key, data, qstate->region, timenow,
334 qstate->env->cfg->serve_expired, qstate->env->scratch);
862 e->qstate->reply = reply;
868 mesh_run(mesh, e->qstate->mesh_info, event, e);
899 /* init module qstate */
1008 mesh_state_delete(struct module_qstate* qstate)
1013 if(!qstate)
1015 mstate = qstate->mesh_info;
1061 mesh_detect_cycle_found(struct module_qstate* qstate, struct mesh_state* dep_m)
1063 struct mesh_state* cyc_m = qstate->mesh_info;
1075 void mesh_detach_subs(struct module_qstate* qstate)
1077 struct mesh_area* mesh = qstate->env->mesh;
1083 lookup.s = qstate->mesh_info;
1084 RBTREE_FOR(ref, struct mesh_state_ref*, &qstate->mesh_info->sub_set) {
1099 rbtree_init(&qstate->mesh_info->sub_set, &mesh_state_ref_compare);
1102 int mesh_add_sub(struct module_qstate* qstate, struct query_info* qinfo,
1107 struct mesh_area* mesh = qstate->env->mesh;
1110 if(mesh_detect_cycle_found(qstate, *sub)) {
1119 *sub = mesh_state_create(qstate->env, qinfo, NULL, qflags, prime,
1148 int mesh_attach_sub(struct module_qstate* qstate, struct query_info* qinfo,
1151 struct mesh_area* mesh = qstate->env->mesh;
1154 if(!mesh_add_sub(qstate, qinfo, qflags, prime, valrec, newq, &sub))
1157 if(!mesh_state_attachment(qstate->mesh_info, sub))
1840 log_query_info(NO_VERBOSE, "pass error for qstate",
1849 log_query_info(VERB_QUERY, "pass error for qstate",
1871 log_query_info(VERB_QUERY, "pass error for qstate",
2055 /* all, including m itself allocated in qstate region */
2062 mesh_detect_cycle(struct module_qstate* qstate, struct query_info* qinfo,
2065 struct mesh_area* mesh = qstate->env->mesh;
2068 return mesh_detect_cycle_found(qstate, dep_m);
2134 apply_respip_action(struct module_qstate* qstate,
2146 alias_rrset, 0, qstate->region, az, NULL))
2163 struct module_qstate* qstate = &mstate->s;
2165 struct mesh_area* mesh = qstate->env->mesh;
2175 struct query_info* lookup_qinfo = &qstate->qinfo;
2178 int must_validate = (!(qstate->query_flags&BIT_CD)
2179 || qstate->env->cfg->ignore_cd) && qstate->env->need_to_validate;
2182 if(!qstate->serve_expired_data) return;
2184 comm_timer_delete(qstate->serve_expired_data->timer);
2185 qstate->serve_expired_data->timer = NULL;
2188 if(qstate->no_cache_lookup || qstate->is_drop) {
2197 qstate->serve_expired_data->get_cached_answer));
2198 msg = (*qstate->serve_expired_data->get_cached_answer)(qstate,
2208 !partial_rep && !apply_respip_action(qstate, &qstate->qinfo,
2209 qstate->client_info, &actinfo, msg->rep, &alias_rrset, &encode_rep,
2210 qstate->env->auth_zones)) {
2213 !respip_merge_cname(partial_rep, &qstate->qinfo, msg->rep,
2214 qstate->client_info, must_validate, &encode_rep, qstate->region,
2215 qstate->env->auth_zones)) {
2241 qinfo_tmp.qtype = qstate->qinfo.qtype;
2242 qinfo_tmp.qclass = qstate->qinfo.qclass;
2250 log_dns_msg("Serve expired lookup", &qstate->qinfo, msg->rep);
2284 qstate->qinfo.qtype, qstate->qinfo.qclass,
2292 qstate->env->cfg->ede_serve_expired &&
2293 qstate->env->cfg->ede &&
2315 if(actinfo.addrinfo && qstate->env->cfg->stat_extended &&
2318 qstate->env->mesh->rpz_action[RPZ_DISABLED_ACTION] += i;
2320 qstate->env->mesh->rpz_action[RPZ_CNAME_OVERRIDE_ACTION] += i;
2322 qstate->env->mesh->rpz_action[
2344 log_assert(qstate->env->mesh->num_reply_states > 0);
2345 qstate->env->mesh->num_reply_states--;
2350 qstate->env->mesh->num_detached_states++;