mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 05:28:00 +00:00
ns_client_endrequest() currently contains code that looks for outstanding quota references and cleans them up if necessary. This approach masks programming errors because ns_client_endrequest() is only called from ns__client_reset_cb(), which in turn is only called when all references to the client's netmgr handle are released, which in turn only happens after all recursion completion callbacks are invoked (because isc_nmhandle_attach() is called before every call to dns_resolver_createfetch() in lib/ns/query.c and the completion callback is expected to detach from the handle), which in turn is expected to happen for all recursions attempts, even those that get canceled. Furthermore, declaring the prototype of ns_client_endrequest() at the top of lib/ns/client.c is redundant because the definition of that function is placed before its first use in that file. Remove the redundant function prototype. Finally, remove INSIST assertions ensuring quota pointers are NULL in ns__client_reset_cb() because the latter calls ns_client_endrequest() a few lines earlier.