mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
Change global task variable to global_task
Remove unused globals
This commit is contained in:
@@ -48,10 +48,6 @@ extern isc_boolean_t have_ipv6, show_details, specified_source,
|
|||||||
extern in_port_t port;
|
extern in_port_t port;
|
||||||
extern unsigned int timeout;
|
extern unsigned int timeout;
|
||||||
extern isc_mem_t *mctx;
|
extern isc_mem_t *mctx;
|
||||||
extern isc_taskmgr_t *taskmgr;
|
|
||||||
extern isc_task_t *task;
|
|
||||||
extern isc_timermgr_t *timermgr;
|
|
||||||
extern isc_socketmgr_t *socketmgr;
|
|
||||||
extern dns_messageid_t id;
|
extern dns_messageid_t id;
|
||||||
extern char *rootspace[BUFSIZE];
|
extern char *rootspace[BUFSIZE];
|
||||||
extern isc_buffer_t rootbuf;
|
extern isc_buffer_t rootbuf;
|
||||||
|
@@ -62,7 +62,7 @@ in_port_t port = 53;
|
|||||||
unsigned int timeout = 5;
|
unsigned int timeout = 5;
|
||||||
isc_mem_t *mctx = NULL;
|
isc_mem_t *mctx = NULL;
|
||||||
isc_taskmgr_t *taskmgr = NULL;
|
isc_taskmgr_t *taskmgr = NULL;
|
||||||
isc_task_t *task = NULL;
|
isc_task_t *global_task = NULL;
|
||||||
isc_timermgr_t *timermgr = NULL;
|
isc_timermgr_t *timermgr = NULL;
|
||||||
isc_socketmgr_t *socketmgr = NULL;
|
isc_socketmgr_t *socketmgr = NULL;
|
||||||
isc_sockaddr_t bind_address;
|
isc_sockaddr_t bind_address;
|
||||||
@@ -478,7 +478,7 @@ setup_libs(void) {
|
|||||||
result = isc_taskmgr_create (mctx, 1, 0, &taskmgr);
|
result = isc_taskmgr_create (mctx, 1, 0, &taskmgr);
|
||||||
check_result(result, "isc_taskmgr_create");
|
check_result(result, "isc_taskmgr_create");
|
||||||
|
|
||||||
result = isc_task_create (taskmgr, 0, &task);
|
result = isc_task_create (taskmgr, 0, &global_task);
|
||||||
check_result(result, "isc_task_create");
|
check_result(result, "isc_task_create");
|
||||||
|
|
||||||
result = isc_timermgr_create (mctx, &timermgr);
|
result = isc_timermgr_create (mctx, &timermgr);
|
||||||
@@ -989,7 +989,7 @@ cancel_lookup(dig_lookup_t *lookup) {
|
|||||||
debug ("Cancelling a worker.");
|
debug ("Cancelling a worker.");
|
||||||
}
|
}
|
||||||
if (query->sock != NULL) {
|
if (query->sock != NULL) {
|
||||||
isc_socket_cancel(query->sock, task,
|
isc_socket_cancel(query->sock, global_task,
|
||||||
ISC_SOCKCANCEL_ALL);
|
ISC_SOCKCANCEL_ALL);
|
||||||
isc_socket_detach(&query->sock);
|
isc_socket_detach(&query->sock);
|
||||||
sockcount--;
|
sockcount--;
|
||||||
@@ -1016,8 +1016,8 @@ send_udp(dig_lookup_t *lookup) {
|
|||||||
|
|
||||||
isc_interval_set(&lookup->interval, timeout, 0);
|
isc_interval_set(&lookup->interval, timeout, 0);
|
||||||
result = isc_timer_create(timermgr, isc_timertype_once, NULL,
|
result = isc_timer_create(timermgr, isc_timertype_once, NULL,
|
||||||
&lookup->interval, task, connect_timeout,
|
&lookup->interval, global_task,
|
||||||
lookup, &lookup->timer);
|
connect_timeout, lookup, &lookup->timer);
|
||||||
check_result(result, "isc_timer_create");
|
check_result(result, "isc_timer_create");
|
||||||
for (query = ISC_LIST_HEAD(lookup->q);
|
for (query = ISC_LIST_HEAD(lookup->q);
|
||||||
query != NULL;
|
query != NULL;
|
||||||
@@ -1030,7 +1030,7 @@ send_udp(dig_lookup_t *lookup) {
|
|||||||
(long int)query->lookup, (long int)query,
|
(long int)query->lookup, (long int)query,
|
||||||
(long int)query->sock);
|
(long int)query->sock);
|
||||||
result = isc_socket_recvv(query->sock, &query->recvlist, 1,
|
result = isc_socket_recvv(query->sock, &query->recvlist, 1,
|
||||||
task, recv_done, query);
|
global_task, recv_done, query);
|
||||||
check_result(result, "isc_socket_recvv");
|
check_result(result, "isc_socket_recvv");
|
||||||
sendcount++;
|
sendcount++;
|
||||||
debug("Sent count number %d", sendcount);
|
debug("Sent count number %d", sendcount);
|
||||||
@@ -1045,7 +1045,7 @@ send_udp(dig_lookup_t *lookup) {
|
|||||||
check_result(result, "isc_time_now");
|
check_result(result, "isc_time_now");
|
||||||
ENSURE (query->sock != NULL);
|
ENSURE (query->sock != NULL);
|
||||||
result = isc_socket_sendtov(query->sock, &query->sendlist,
|
result = isc_socket_sendtov(query->sock, &query->sendlist,
|
||||||
task, send_done, query,
|
global_task, send_done, query,
|
||||||
&query->sockaddr, NULL);
|
&query->sockaddr, NULL);
|
||||||
check_result(result, "isc_socket_sendtov");
|
check_result(result, "isc_socket_sendtov");
|
||||||
}
|
}
|
||||||
@@ -1225,16 +1225,16 @@ launch_next_query(dig_query_t *query, isc_boolean_t include_question) {
|
|||||||
}
|
}
|
||||||
ISC_LIST_ENQUEUE(query->lengthlist, &query->lengthbuf, link);
|
ISC_LIST_ENQUEUE(query->lengthlist, &query->lengthbuf, link);
|
||||||
|
|
||||||
result = isc_socket_recvv(query->sock, &query->lengthlist, 0, task,
|
result = isc_socket_recvv(query->sock, &query->lengthlist, 0,
|
||||||
tcp_length_done, query);
|
global_task, tcp_length_done, query);
|
||||||
check_result(result, "isc_socket_recvv");
|
check_result(result, "isc_socket_recvv");
|
||||||
sendcount++;
|
sendcount++;
|
||||||
if (!query->first_soa_rcvd) {
|
if (!query->first_soa_rcvd) {
|
||||||
debug("Sending a request.");
|
debug("Sending a request.");
|
||||||
result = isc_time_now(&query->time_sent);
|
result = isc_time_now(&query->time_sent);
|
||||||
check_result(result, "isc_time_now");
|
check_result(result, "isc_time_now");
|
||||||
result = isc_socket_sendv(query->sock, &query->sendlist, task,
|
result = isc_socket_sendv(query->sock, &query->sendlist,
|
||||||
send_done, query);
|
global_task, send_done, query);
|
||||||
check_result(result, "isc_socket_recvv");
|
check_result(result, "isc_socket_recvv");
|
||||||
}
|
}
|
||||||
query->waiting_connect = ISC_FALSE;
|
query->waiting_connect = ISC_FALSE;
|
||||||
@@ -1538,8 +1538,8 @@ do_lookup_tcp(dig_lookup_t *lookup) {
|
|||||||
lookup->pending = ISC_TRUE;
|
lookup->pending = ISC_TRUE;
|
||||||
isc_interval_set(&lookup->interval, timeout, 0);
|
isc_interval_set(&lookup->interval, timeout, 0);
|
||||||
result = isc_timer_create(timermgr, isc_timertype_once, NULL,
|
result = isc_timer_create(timermgr, isc_timertype_once, NULL,
|
||||||
&lookup->interval, task, connect_timeout,
|
&lookup->interval, global_task,
|
||||||
lookup, &lookup->timer);
|
connect_timeout, lookup, &lookup->timer);
|
||||||
check_result(result, "isc_timer_create");
|
check_result(result, "isc_timer_create");
|
||||||
|
|
||||||
for (query = ISC_LIST_HEAD(lookup->q);
|
for (query = ISC_LIST_HEAD(lookup->q);
|
||||||
@@ -1561,7 +1561,7 @@ do_lookup_tcp(dig_lookup_t *lookup) {
|
|||||||
check_result(result, "isc_socket_bind");
|
check_result(result, "isc_socket_bind");
|
||||||
}
|
}
|
||||||
result = isc_socket_connect(query->sock, &query->sockaddr,
|
result = isc_socket_connect(query->sock, &query->sockaddr,
|
||||||
task, connect_done, query);
|
global_task, connect_done, query);
|
||||||
check_result (result, "isc_socket_connect");
|
check_result (result, "isc_socket_connect");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1699,8 +1699,8 @@ free_lists(int _exitcode) {
|
|||||||
isc_socketmgr_destroy(&socketmgr);
|
isc_socketmgr_destroy(&socketmgr);
|
||||||
if (timermgr != NULL)
|
if (timermgr != NULL)
|
||||||
isc_timermgr_destroy(&timermgr);
|
isc_timermgr_destroy(&timermgr);
|
||||||
if (task != NULL)
|
if (global_task != NULL)
|
||||||
isc_task_detach(&task);
|
isc_task_detach(&global_task);
|
||||||
if (taskmgr != NULL)
|
if (taskmgr != NULL)
|
||||||
isc_taskmgr_destroy(&taskmgr);
|
isc_taskmgr_destroy(&taskmgr);
|
||||||
|
|
||||||
|
@@ -40,10 +40,6 @@ extern isc_boolean_t have_ipv6, show_details;
|
|||||||
extern in_port_t port;
|
extern in_port_t port;
|
||||||
extern unsigned int timeout;
|
extern unsigned int timeout;
|
||||||
extern isc_mem_t *mctx;
|
extern isc_mem_t *mctx;
|
||||||
extern isc_taskmgr_t *taskmgr;
|
|
||||||
extern isc_task_t *task;
|
|
||||||
extern isc_timermgr_t *timermgr;
|
|
||||||
extern isc_socketmgr_t *socketmgr;
|
|
||||||
extern dns_messageid_t id;
|
extern dns_messageid_t id;
|
||||||
extern dns_name_t rootorg;
|
extern dns_name_t rootorg;
|
||||||
extern char *rootspace[BUFSIZE];
|
extern char *rootspace[BUFSIZE];
|
||||||
|
@@ -45,10 +45,6 @@ extern isc_boolean_t have_ipv6, show_details,
|
|||||||
extern in_port_t port;
|
extern in_port_t port;
|
||||||
extern unsigned int timeout;
|
extern unsigned int timeout;
|
||||||
extern isc_mem_t *mctx;
|
extern isc_mem_t *mctx;
|
||||||
extern isc_taskmgr_t *taskmgr;
|
|
||||||
extern isc_task_t *task;
|
|
||||||
extern isc_timermgr_t *timermgr;
|
|
||||||
extern isc_socketmgr_t *socketmgr;
|
|
||||||
extern dns_messageid_t id;
|
extern dns_messageid_t id;
|
||||||
extern char *rootspace[BUFSIZE];
|
extern char *rootspace[BUFSIZE];
|
||||||
extern isc_buffer_t rootbuf;
|
extern isc_buffer_t rootbuf;
|
||||||
|
Reference in New Issue
Block a user