Fix "dig +nssearch" indefinitely hanging issue
When finishing the NSSEARCH task and there is no more followup lookups to start, dig does not destroy the last lookup, which causes it to hang indefinitely.
Rename the unused first_pass
member of dig_query_t
to started
and make it true
in the first callback after start_udp()
or
start_tcp()
of the query to indicate that the query has been
started.
Create a new check_if_queries_done()
function to check whether
all of the queries inside a lookup have been started and finished,
or canceled.
Use the mentioned function in the TRACE code block in recv_done()
to check whether the current query is the last one in the lookup and
cancel the lookup in that case to free the resources.
Closes #3145 (closed)
Edited by Arаm Sаrgsyаn