mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-26 03:11:56 -05:00
[v9_9] dig could miss tcp connections when cleaning up
3679. [bug] dig could fail to clean up TCP sockets still
waiting on connect(). [RT #35074]
(cherry picked from commit fb507315d4)
This commit is contained in:
parent
559f5c10f8
commit
5a91e2b5d4
2 changed files with 26 additions and 8 deletions
3
CHANGES
3
CHANGES
|
|
@ -1,3 +1,6 @@
|
|||
3679. [bug] dig could fail to clean up TCP sockets still
|
||||
waiting on connect(). [RT #35074]
|
||||
|
||||
3678. [port] Update config.guess and config.sub. [RT #35060]
|
||||
|
||||
3677. [bug] 'nsupdate' leaked memory if 'realm' was used multiple
|
||||
|
|
|
|||
|
|
@ -1325,6 +1325,7 @@ setup_libs(void) {
|
|||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
check_result(result, "isc_mem_create");
|
||||
isc_mem_setname(mctx, "dig", NULL);
|
||||
|
||||
result = isc_log_create(mctx, &lctx, &logconfig);
|
||||
check_result(result, "isc_log_create");
|
||||
|
|
@ -1343,6 +1344,7 @@ setup_libs(void) {
|
|||
|
||||
result = isc_task_create(taskmgr, 0, &global_task);
|
||||
check_result(result, "isc_task_create");
|
||||
isc_task_setname(global_task, "dig", NULL);
|
||||
|
||||
result = isc_timermgr_create(mctx, &timermgr);
|
||||
check_result(result, "isc_timermgr_create");
|
||||
|
|
@ -3735,18 +3737,31 @@ cancel_all(void) {
|
|||
if (current_lookup != NULL) {
|
||||
if (current_lookup->timer != NULL)
|
||||
isc_timer_detach(¤t_lookup->timer);
|
||||
q = ISC_LIST_HEAD(current_lookup->q);
|
||||
while (q != NULL) {
|
||||
debug("canceling query %p, belonging to %p",
|
||||
q, current_lookup);
|
||||
for (q = ISC_LIST_HEAD(current_lookup->q);
|
||||
q != NULL;
|
||||
q = nq)
|
||||
{
|
||||
nq = ISC_LIST_NEXT(q, link);
|
||||
if (q->sock != NULL) {
|
||||
debug("canceling pending query %p, belonging to %p",
|
||||
q, current_lookup);
|
||||
if (q->sock != NULL)
|
||||
isc_socket_cancel(q->sock, NULL,
|
||||
ISC_SOCKCANCEL_ALL);
|
||||
} else {
|
||||
else
|
||||
clear_query(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);
|
||||
if (q->sock != NULL)
|
||||
isc_socket_cancel(q->sock, NULL,
|
||||
ISC_SOCKCANCEL_ALL);
|
||||
else
|
||||
clear_query(q);
|
||||
}
|
||||
q = nq;
|
||||
}
|
||||
}
|
||||
l = ISC_LIST_HEAD(lookup_list);
|
||||
|
|
|
|||
Loading…
Reference in a new issue