/* TODO: uncomment these once we actually use the information it collects. */
/**
* Check if there is a existing TCP connection to this address.
- *
+ *
* @p req has to have the selection_context properly initiazed.
*/
void check_tcp_connections(struct address_state *address_state, struct kr_request *req, struct sockaddr *address) {
} else {
qry->flags.TCP = true;
qry->flags.NO_0X20 = true;
+ qry->server_selection.local_state->dont_resolve = true;
}
break;
case KR_SELECTION_TRUNCATED:
addr_state->error_count++;
addr_state->errors[sel_error]++;
-
+
WITH_VERBOSE(qry)
{
KR_DNAME_GET_STR(ns_name, transport->ns_name);
/** Force resolution of a new NS name (if possible)
* Done by selection.c:error in some cases. */
bool force_resolve;
+ /** Disable resolution of new NS name for the next attempt. */
+ bool dont_resolve;
void *private; /**< Inner state of the implementation.*/
};
name_state->a_state = RECORD_UNKNOWN;
name_state->aaaa_state = RECORD_UNKNOWN;
}
-
+
/* Iterate over all addresses of this NS (if any). */
for (uint8_t *obj = pack_head(*addresses); obj != pack_tail(*addresses);
obj = pack_obj_next(obj)) {
qry->server_selection.local_state->force_resolve = false;
}
+ if (qry->server_selection.local_state->dont_resolve && choices_len) {
+ resolvable_len = 0;
+ qry->server_selection.local_state->dont_resolve = false;
+ }
+
bool tcp = qry->flags.TCP || qry->server_selection.local_state->truncated;
*transport = select_transport(choices, choices_len, resolvable, resolvable_len,
qry->server_selection.local_state->timeouts,