2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Remove isc_app_block() from dig's get_address().

This commit is contained in:
Michael Sawyer
2000-09-21 23:02:34 +00:00
parent f900be2190
commit b8f9623df0
4 changed files with 10 additions and 22 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dig.c,v 1.95 2000/09/21 22:46:34 mws Exp $ */
/* $Id: dig.c,v 1.96 2000/09/21 23:02:30 mws Exp $ */
#include <config.h>
#include <stdlib.h>
@@ -974,7 +974,7 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
rv++;
rc--;
}
get_address(address, 0, &bind_address, ISC_FALSE);
get_address(address, 0, &bind_address);
specified_source = ISC_TRUE;
} else if (strncmp(rv[0], "-h", 2) == 0) {
show_usage();

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dighost.c,v 1.130 2000/09/21 22:46:36 mws Exp $ */
/* $Id: dighost.c,v 1.131 2000/09/21 23:02:32 mws Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
@@ -1475,8 +1475,7 @@ send_tcp_connect(dig_query_t *query) {
l = query->lookup;
query->waiting_connect = ISC_TRUE;
query->lookup->current_query = query;
get_address(query->servname, port, &query->sockaddr,
ISC_TRUE);
get_address(query->servname, port, &query->sockaddr);
if (specified_source &&
(isc_sockaddr_pf(&query->sockaddr) !=
@@ -1549,8 +1548,7 @@ send_udp(dig_query_t *query) {
if (!query->recv_made) {
/* XXX Check the sense of this, need assertion? */
query->waiting_connect = ISC_FALSE;
get_address(query->servname, port, &query->sockaddr,
ISC_TRUE);
get_address(query->servname, port, &query->sockaddr);
result = isc_socket_create(socketmgr,
isc_sockaddr_pf(&query->sockaddr),
@@ -2380,8 +2378,7 @@ recv_done(isc_task_t *task, isc_event_t *event) {
* routines, since they may be using a non-DNS system for these lookups.
*/
void
get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr,
isc_boolean_t running) {
get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr) {
struct in_addr in4;
struct in6_addr in6;
#if defined(HAVE_ADDRINFO) && defined(HAVE_GETADDRINFO)
@@ -2400,12 +2397,8 @@ get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr,
else {
#if defined(HAVE_ADDRINFO) && defined(HAVE_GETADDRINFO)
debug ("before getaddrinfo()");
if (running)
isc_app_block();
is_blocking = ISC_TRUE;
result = getaddrinfo(host, NULL, NULL, &res);
if (running)
isc_app_unblock();
is_blocking = ISC_FALSE;
if (result != 0) {
fatal("Couldn't find server '%s': %s",
@@ -2417,12 +2410,8 @@ get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr,
freeaddrinfo(res);
#else
debug ("before gethostbyname()");
if (running)
isc_app_block();
is_blocking = ISC_TRUE;
he = gethostbyname(host);
if (running)
isc_app_unblock();
is_blocking = ISC_FALSE;
if (he == NULL)
fatal("Couldn't find server '%s' (h_errno=%d)",

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dig.h,v 1.46 2000/09/21 22:46:39 mws Exp $ */
/* $Id: dig.h,v 1.47 2000/09/21 23:02:34 mws Exp $ */
#ifndef DIG_H
#define DIG_H
@@ -168,8 +168,7 @@ struct dig_searchlist {
* Routines in dighost.c.
*/
void
get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr,
isc_boolean_t running);
get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr);
void
fatal(const char *format, ...);

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: nslookup.c,v 1.49 2000/09/21 22:46:37 mws Exp $ */
/* $Id: nslookup.c,v 1.50 2000/09/21 23:02:33 mws Exp $ */
#include <config.h>
@@ -562,7 +562,7 @@ show_settings(isc_boolean_t full, isc_boolean_t serv_only) {
while (srv != NULL) {
result = isc_buffer_allocate(mctx, &b, MXNAME);
check_result(result, "isc_buffer_allocate");
get_address(srv->servername, 53, &sockaddr, ISC_FALSE);
get_address(srv->servername, 53, &sockaddr);
result = isc_sockaddr_totext(&sockaddr, b);
check_result(result, "isc_sockaddr_totext");
printf("Default server: %s\nAddress: %.*s\n",