dns_fixedname_init(&looknew->fdomain);
ISC_LINK_INIT(looknew, link);
ISC_LIST_INIT(looknew->q);
- ISC_LIST_INIT(looknew->connecting);
ISC_LIST_INIT(looknew->my_server_list);
isc_refcount_init(&looknew->references, 1);
isc_refcount_destroy(&lookup->references);
REQUIRE(ISC_LIST_EMPTY(lookup->q));
- REQUIRE(ISC_LIST_EMPTY(lookup->connecting));
s = ISC_LIST_HEAD(lookup->my_server_list);
while (s != NULL) {
if (ISC_LINK_LINKED(query, link)) {
ISC_LIST_UNLINK(lookup->q, query, link);
}
- if (ISC_LINK_LINKED(query, clink)) {
- ISC_LIST_UNLINK(lookup->connecting, query, clink);
- }
debug("%s:%u:query_detach(%p) = %" PRIuFAST32, file, line, query,
isc_refcount_current(&query->references) - 1);
dig_lookup_t *lookup = current_lookup;
INSIST(!free_now);
- INSIST(lookup != NULL);
debug("clear_current_lookup()");
} else {
next = NULL;
}
- ISC_LIST_ENQUEUE(query->lookup->connecting, query, clink);
if (next != NULL) {
start_tcp(next);
}
char sockstr[ISC_SOCKADDR_FORMATSIZE];
dig_lookup_t *l = NULL;
+ debug("tcp_connected()");
+
+ if (atomic_load(&cancel_now)) {
+ return;
+ }
+
REQUIRE(DIG_VALID_QUERY(query));
REQUIRE(query->handle == NULL);
- INSIST(!free_now);
-
- debug("tcp_connected()");
+ REQUIRE(!free_now);
LOCK_LOOKUP;
lookup_attach(query->lookup, &l);
LOCK_LOOKUP;
lookup_attach(query->lookup, &l);
+ isc_refcount_decrement0(&recvcount);
+ debug("recvcount=%" PRIuFAST32, isc_refcount_current(&recvcount));
+
if (eresult == ISC_R_CANCELED) {
debug("recv_done: cancel");
goto detach_query;
}
- isc_refcount_decrement0(&recvcount);
- debug("recvcount=%" PRIuFAST32, isc_refcount_current(&recvcount));
-
TIME_NOW(&query->time_recv);
if (eresult == ISC_R_TIMEDOUT && !l->tcp_mode && l->retries > 1) {
}
query_detach(&q);
}
- for (q = ISC_LIST_HEAD(current_lookup->connecting); q != NULL;
- q = nq) {
- nq = ISC_LIST_NEXT(q, clink);
- debug("canceling connecting query %p, belonging to %p",
- q, current_lookup);
- query_detach(&q);
- }
lookup_detach(¤t_lookup);
}
l = ISC_LIST_HEAD(lookup_list);
struct dig_lookup {
unsigned int magic;
isc_refcount_t references;
- bool pending, /*%< Pending a successful answer */
- waiting_connect, doing_xfr, ns_search_only, /*%< dig
- * +nssearch,
- * host -C */
+ bool pending, /*%< Pending a successful answer */
+ doing_xfr, ns_search_only, /*%< dig +nssearch, host -C */
identify, /*%< Append an "on server <foo>" message */
identify_previous_line, /*% Prepend a "Nameserver <foo>:"
* message, with newline and tab */