When outgoing TCP connection was prematurely terminated (f.e. with
connection reset), the dispatch code would not cleanup the resources
used by such connection leading to dangling dns_dispentry_t entries.
"shutting down due to TCP "
"receive error: %s: %s",
buf, isc_result_totext(eresult));
+ /*
+ * If there are any active responses, shut them all down.
+ */
+ for (resp = ISC_LIST_HEAD(disp->active); resp != NULL;
+ resp = next) {
+ next = ISC_LIST_NEXT(resp, alink);
+ dispentry_attach(resp, &(dns_dispentry_t *){ NULL });
+ ISC_LIST_UNLINK(disp->active, resp, alink);
+ ISC_LIST_APPEND(resps, resp, rlink);
+ }
goto done;
}