Commit cc5ea458 authored by Michael Sawyer's avatar Michael Sawyer
Browse files

Fixed accidental commit of Makefile instead of Makefile.in.

Added TCP mode to dig.  AXFR code partially written.
Merged into configure.in, bin/Makefile.in.
parent e9a9ae4f
...@@ -17,7 +17,7 @@ srcdir = @srcdir@ ...@@ -17,7 +17,7 @@ srcdir = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
SUBDIRS = named lwresd rndc tests SUBDIRS = named lwresd rndc tests dig
TARGETS = TARGETS =
@BIND9_MAKE_RULES@ @BIND9_MAKE_RULES@
# Generated automatically from Makefile.in by configure.
# Copyright (C) 1998, 1999, 2000 Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
# ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
# CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.
srcdir = .
top_srcdir = ../..
# Copyright (C) 1999, 2000 Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
# ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
# CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.
# Search for machine-generated header files in the build tree,
# and for normal headers in the source tree (${top_srcdir}).
# We only need to look in OS-specific subdirectories for the
# latter case, because there are no machine-generated OS-specific
# headers.
ISC_INCLUDES = -I/export/home/mws/bind9/lib/isc/include \
-I${top_srcdir}/lib/isc \
-I${top_srcdir}/lib/isc/include \
-I${top_srcdir}/lib/isc/unix/include \
-I${top_srcdir}/lib/isc/pthreads/include
DNS_INCLUDES = -I/export/home/mws/bind9/lib/dns/include \
-I${top_srcdir}/lib/dns/include \
-I${top_srcdir}/lib/dns/sec/dst/include
OMAPI_INCLUDES = -I/export/home/mws/bind9/lib/omapi/include \
-I${top_srcdir}/lib/omapi/include
LWRES_INCLUDES = -I/export/home/mws/bind9/lib/lwres/include \
-I${top_srcdir}/lib/lwres/include
TEST_INCLUDES = \
-I${top_srcdir}/lib/tests/include
CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} ${LWRES_INCLUDES} \
${OMAPI_INCLUDES} -I./unix/include -I./include
CDEFINES =
CWARNINGS =
DNSLIBS = ../../lib/dns/libdns.a
ISCLIBS = ../../lib/isc/libisc.a
OMAPILIBS = ../../lib/omapi/libomapi.a
LWRESLIBS = ../../lib/lwres/liblwres.a
DNSDEPLIBS = ../../lib/dns/libdns.a
ISCDEPLIBS = ../../lib/isc/libisc.a
OMAPIDEPLIBS = ../../lib/omapi/libomapi.a
LWRESDEPLIBS = ../../lib/lwres/liblwres.a
LIBS = -lnsl -lsocket -lpthread -lthread
SUBDIRS = db dst master mem names rbt sockaddr tasks timers
# Alphabetically
TARGETS = dig
# Alphabetically
SRCS = dig.c\
printmsg.c
# Copyright (C) 1998, 1999, 2000 Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
# ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
# CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.
###
### Common Makefile rules for BIND 9.
###
###
### Paths
###
### Note: paths that vary by Makefile MUST NOT be listed
### here, or they won't get expanded correctly.
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
includedir = ${prefix}/include
libdir = ${exec_prefix}/lib
sysconfdir = /etc
localstatedir = /var
DESTDIR =
top_builddir = /export/home/mws/bind9
###
### All
###
### Makefile may define:
### TARGETS
all: subdirs ${TARGETS}
###
### Subdirectories
###
### Makefile may define:
### SUBDIRS
ALL_SUBDIRS = ${SUBDIRS} nulldir
#
# We use a single-colon rule so that additional dependencies of
# subdirectories can be specified after the inclusion of this file.
# The "depend" target is treated the same way.
#
subdirs:
@for i in ${ALL_SUBDIRS}; do \
if [ "$$i" != "nulldir" -a -d $$i ]; then \
echo "making all in `pwd`/$$i"; \
(cd $$i; ${MAKE} ${MAKEDEFS} all); \
fi \
done
install clean distclean::
@for i in ${ALL_SUBDIRS}; do \
if [ "$$i" != "nulldir" -a -d $$i ]; then \
echo "making $@ in `pwd`/$$i"; \
(cd $$i; ${MAKE} ${MAKEDEFS} $@); \
fi \
done
###
### C Programs
###
### Makefile must define
### CC
### Makefile may define
### CFLAGS
### CINCLUDES
### CDEFINES
### CWARNINGS
CC = gcc
CFLAGS = -g -O2
STD_CINCLUDES =
STD_CDEFINES =
STD_CWARNINGS = -W -Wall -Wmissing-prototypes
.SUFFIXES:
.SUFFIXES: .c .o
ALWAYS_INCLUDES = -I${top_builddir}
ALWAYS_DEFINES = -D_REENTRANT
ALWAYS_WARNINGS =
ALL_CPPFLAGS = \
${ALWAYS_INCLUDES} ${CINCLUDES} ${STD_CINCLUDES} \
${ALWAYS_DEFINES} ${CDEFINES} ${STD_CDEFINES}
ALL_CFLAGS = ${CFLAGS} \
${ALL_CPPFLAGS} \
${ALWAYS_WARNINGS} ${STD_CWARNINGS} ${CWARNINGS}
.c.o:
${LIBTOOL} ${CC} ${ALL_CFLAGS} -c $<
SHELL = /bin/sh
LIBTOOL =
MKDEP = ${SHELL} ${top_builddir}/make/mkdep
clean distclean::
rm -f *.o *.lo *.la core *.core
rm -rf .libs
distclean::
rm -f Makefile
depend:
@for i in ${ALL_SUBDIRS}; do \
if [ "$$i" != "nulldir" -a -d $$i ]; then \
echo "making depend in `pwd`/$$i"; \
(cd $$i; ${MAKE} ${MAKEDEFS} $@); \
fi \
done
@if [ X"${SRCS}" != X -a X"${PSRCS}" != X ] ; then \
echo ${MKDEP} ${ALL_CPPFLAGS} ${SRCS}; \
${MKDEP} ${ALL_CPPFLAGS} ${SRCS}; \
echo ${MKDEP} -ap ${ALL_CPPFLAGS} ${PSRCS}; \
${MKDEP} -ap ${ALL_CPPFLAGS} ${PSRCS}; \
elif [ X"${SRCS}" != X ] ; then \
echo ${MKDEP} ${ALL_CPPFLAGS} ${SRCS}; \
${MKDEP} ${ALL_CPPFLAGS} ${SRCS}; \
elif [ X"${PSRCS}" != X ] ; then \
echo ${MKDEP} ${ALL_CPPFLAGS} ${PSRCS}; \
${MKDEP} -p ${ALL_CPPFLAGS} ${PSRCS}; \
fi
FORCE:
###
### Libraries
###
AR = /usr/ccs/bin/ar
ARFLAGS = cruv
RANLIB = ranlib
###
### Installation
###
INSTALL = /export/home/mws/bind9/install-sh -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
all: ${TARGETS}
dig: dig.o printmsg.o ${ISCDEPLIBS} ${DNSDEPLIBS}
${LIBTOOL} ${CC} ${CFLAGS} -o $@ dig.o printmsg.o\
${DNSLIBS} ${ISCLIBS} ${LIBS}
distclean::
rm -f headerdep_test.sh
clean distclean::
rm -f ${TARGETS} ${XTARGETS}
rm -f t_journal
# Copyright (C) 1998, 1999, 2000 Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
# ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
# CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
@BIND9_VERSION@
@BIND9_INCLUDES@
CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include \
${DNS_INCLUDES} ${ISC_INCLUDES} ${OMAPI_INCLUDES}
CDEFINES =
CWARNINGS =
OMAPILIBS = ../../lib/omapi/libomapi.@A@
DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_OPENSSL_LIBS@
ISCLIBS = ../../lib/isc/libisc.@A@
OMAPIDEPLIBS = ../../lib/omapi/libomapi.@A@
DNSDEPLIBS = ../../lib/dns/libdns.@A@
ISCDEPLIBS = ../../lib/isc/libisc.@A@
DEPLIBS = ${OMAPIDEPLIBS} ${DNSDEPLIBS} ${ISCDEPLIBS}
LIBS = ${OMAPILIBS} ${DNSLIBS} ${ISCLIBS} @LIBS@
SUBDIRS = unix
TARGETS = dig
OBJS = dig.@O@ printmsg.@O@
UOBJS =
SRCS = dig.c printmsg.c
@BIND9_MAKE_RULES@
dig: ${OBJS} ${UOBJS} ${DEPLIBS}
${LIBTOOL} ${CC} ${CFLAGS} -o $@ ${OBJS} ${UOBJS} ${LIBS}
clean distclean::
rm -f ${TARGETS}
installdirs:
if [ ! -d ${DESTDIR}${sbindir} ]; then \
mkdir ${DESTDIR}${sbindir}; \
fi
install:: dig installdirs
${LIBTOOL} ${INSTALL_PROGRAM} dig ${DESTDIR}${sbindir}
...@@ -56,8 +56,7 @@ extern int h_errno; ...@@ -56,8 +56,7 @@ extern int h_errno;
#include <dig/dig.h> #include <dig/dig.h>
#include <dig/printmsg.h> #include <dig/printmsg.h>
#undef DEBUG #define DEBUG
#undef MEMDEBUG
ISC_LIST(dig_lookup_t) lookup_list; ISC_LIST(dig_lookup_t) lookup_list;
ISC_LIST(dig_server_t) server_list; ISC_LIST(dig_server_t) server_list;
...@@ -78,6 +77,28 @@ char *rootspace[BUFSIZE]; ...@@ -78,6 +77,28 @@ char *rootspace[BUFSIZE];
isc_buffer_t rootbuf; isc_buffer_t rootbuf;
int sendcount=0; int sendcount=0;
static void
free_lists();
static void
hex_dump(isc_buffer_t *b)
{
unsigned int len;
isc_region_t r;
isc_buffer_remaining(b, &r);
printf ("Printing a buffer with length %d\n",r.length);
for (len = 0 ; len < r.length ; len++) {
printf("%02x ", r.base[len]);
if (len != 0 && len % 16 == 0)
printf("\n");
}
if (len % 16 != 0)
printf("\n");
}
static void static void
fatal(char *format, ...) { fatal(char *format, ...) {
va_list args; va_list args;
...@@ -86,9 +107,7 @@ fatal(char *format, ...) { ...@@ -86,9 +107,7 @@ fatal(char *format, ...) {
vfprintf(stderr, format, args); vfprintf(stderr, format, args);
va_end(args); va_end(args);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
#ifdef NEVER
free_lists(); free_lists();
#endif
exit(1); exit(1);
} }
...@@ -128,8 +147,8 @@ istype(char *text) { ...@@ -128,8 +147,8 @@ istype(char *text) {
"gpos", "aaaa", "loc", "nxt", "gpos", "aaaa", "loc", "nxt",
"srv", "naptr", "kx", "cert", "srv", "naptr", "kx", "cert",
"a6", "dname", "opt", "unspec", "a6", "dname", "opt", "unspec",
"tkey", "tsig"}; "tkey", "tsig", "axfr"};
static const int numtypes = 40; static const int numtypes = 41;
int i; int i;
for (i=0;i<numtypes;i++) { for (i=0;i<numtypes;i++) {
...@@ -195,6 +214,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) { ...@@ -195,6 +214,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
lookup->sendmsg=NULL; lookup->sendmsg=NULL;
lookup->name=NULL; lookup->name=NULL;
lookup->timer = NULL; lookup->timer = NULL;
lookup->xfr_q = NULL;
ISC_LIST_INIT(lookup->q); ISC_LIST_INIT(lookup->q);
ISC_LIST_APPEND(lookup_list, lookup, link); ISC_LIST_APPEND(lookup_list, lookup, link);
have_host = ISC_TRUE; have_host = ISC_TRUE;
...@@ -228,6 +248,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) { ...@@ -228,6 +248,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
lookup->sendmsg=NULL; lookup->sendmsg=NULL;
lookup->name=NULL; lookup->name=NULL;
lookup->timer = NULL; lookup->timer = NULL;
lookup->xfr_q = NULL;
ISC_LIST_INIT(lookup->q); ISC_LIST_INIT(lookup->q);
strcpy (lookup->textname,"."); strcpy (lookup->textname,".");
strcpy (lookup->rttext, "NS"); strcpy (lookup->rttext, "NS");
...@@ -389,6 +410,8 @@ setup_lookup(dig_lookup_t *lookup) { ...@@ -389,6 +410,8 @@ setup_lookup(dig_lookup_t *lookup) {
r.length=strlen(lookup->rttext); r.length=strlen(lookup->rttext);
result = dns_rdatatype_fromtext(&rdtype, &r); result = dns_rdatatype_fromtext(&rdtype, &r);
check_result (result, "dns_rdatatype_fromtext"); check_result (result, "dns_rdatatype_fromtext");
if (rdtype == dns_rdatatype_axfr)
lookup->doing_xfr = ISC_TRUE;
r.base=lookup->rctext; r.base=lookup->rctext;
r.length=strlen(lookup->rctext); r.length=strlen(lookup->rctext);
result = dns_rdataclass_fromtext(&rdclass, &r); result = dns_rdataclass_fromtext(&rdclass, &r);
...@@ -428,10 +451,9 @@ setup_lookup(dig_lookup_t *lookup) { ...@@ -428,10 +451,9 @@ setup_lookup(dig_lookup_t *lookup) {
COMMSIZE, ISC_BUFFERTYPE_BINARY); COMMSIZE, ISC_BUFFERTYPE_BINARY);
isc_buffer_init (&query->lengthbuf, query->lengthspace, isc_buffer_init (&query->lengthbuf, query->lengthspace,
2, ISC_BUFFERTYPE_BINARY); 2, ISC_BUFFERTYPE_BINARY);
isc_buffer_init (&query->slbuf, query->slspace,
2, ISC_BUFFERTYPE_BINARY);
ISC_LIST_ENQUEUE (query->recvlist, &query->recvbuf, link);
ISC_LIST_ENQUEUE (query->sendlist, &lookup->sendbuf, link);
ISC_LIST_ENQUEUE (query->lengthlist, &query->lengthbuf, link);
ISC_LIST_ENQUEUE (lookup->q, query, link); ISC_LIST_ENQUEUE (lookup->q, query, link);
} }
} }
...@@ -446,6 +468,9 @@ static void ...@@ -446,6 +468,9 @@ static void
cancel_lookup (dig_lookup_t *lookup) { cancel_lookup (dig_lookup_t *lookup) {
dig_query_t *query; dig_query_t *query;
#ifdef DEBUG
puts ("Cancelling all queries");
#endif
if (!lookup->pending) if (!lookup->pending)
return; return;
lookup->pending = ISC_FALSE; lookup->pending = ISC_FALSE;
...@@ -467,7 +492,7 @@ check_next_lookup (dig_lookup_t *lookup) { ...@@ -467,7 +492,7 @@ check_next_lookup (dig_lookup_t *lookup) {
dig_lookup_t *next; dig_lookup_t *next;
dig_query_t *query; dig_query_t *query;
isc_boolean_t still_working=ISC_FALSE; isc_boolean_t still_working=ISC_FALSE;
for (query = ISC_LIST_HEAD(lookup->q); for (query = ISC_LIST_HEAD(lookup->q);
query != NULL; query != NULL;
query = ISC_LIST_NEXT(query, link)) { query = ISC_LIST_NEXT(query, link)) {
...@@ -497,8 +522,9 @@ check_next_lookup (dig_lookup_t *lookup) { ...@@ -497,8 +522,9 @@ check_next_lookup (dig_lookup_t *lookup) {
} }
/* connect_timeout is used for both UDP recieves and TCP connects. */
static void static void
recv_timeout (isc_task_t *task, isc_event_t *event) { connect_timeout (isc_task_t *task, isc_event_t *event) {
dig_lookup_t *lookup; dig_lookup_t *lookup;
dig_query_t *q=NULL; dig_query_t *q=NULL;
isc_result_t result; isc_result_t result;
...@@ -514,18 +540,190 @@ recv_timeout (isc_task_t *task, isc_event_t *event) { ...@@ -514,18 +540,190 @@ recv_timeout (isc_task_t *task, isc_event_t *event) {
for (q = ISC_LIST_HEAD(lookup->q); for (q = ISC_LIST_HEAD(lookup->q);
q != NULL; q != NULL;
q = ISC_LIST_NEXT(q, link)) { q = ISC_LIST_NEXT(q, link)) {
isc_buffer_clear (b); if (q->working) {
result = isc_sockaddr_totext(&q->sockaddr, b); isc_buffer_clear (b);
check_result (result, "isc_sockaddr_totext"); result = isc_sockaddr_totext(&q->sockaddr, b);
isc_buffer_used(b, &r); check_result (result, "isc_sockaddr_totext");
printf (";; Connection to server %.*s for %s failed: Connection timed out.\n", isc_buffer_used(b, &r);
(int)r.length, r.base, q->lookup->textname); printf (";; Connection to server %.*s for %s failed: Connection timed out.\n",
isc_socket_cancel(q->sock, task, ISC_SOCKCANCEL_ALL); (int)r.length, r.base, q->lookup->textname);
isc_socket_cancel(q->sock, task, ISC_SOCKCANCEL_ALL);
}
} }
ENSURE (lookup->timer != NULL);
isc_timer_detach (&lookup->timer);
isc_buffer_free (&b); isc_buffer_free (&b);
isc_event_free (&event);
lookup->pending = ISC_FALSE; lookup->pending = ISC_FALSE;
} }
static void
recv_done (isc_task_t *task, isc_event_t *event) ;
static void
tcp_length_done (isc_task_t *task, isc_event_t *event) {
isc_socketevent_t *sevent;
isc_buffer_t *b=NULL;
isc_region_t r;
isc_result_t result;
dig_query_t *query=NULL;
isc_uint16_t length;
UNUSED (task);
#ifdef DEBUG
puts ("In tcp_length_done");
#endif
REQUIRE (event->ev_type == ISC_SOCKEVENT_RECVDONE);
sevent = (isc_socketevent_t *)event;
query = event->ev_arg;
if (sevent->result == ISC_R_CANCELED) {
query->working = ISC_FALSE;
isc_socket_detach (&query->sock);
check_next_lookup(query->lookup);
isc_event_free (&event);
return;
}
if (sevent->result != ISC_R_SUCCESS) {
result = isc_buffer_allocate(mctx, &b, 256,
ISC_BUFFERTYPE_TEXT);
check_result (result, "isc_buffer_allocate");
result = isc_sockaddr_totext(&query->sockaddr, b);
check_result (result, "isc_sockaddr_totext");
isc_buffer_used(b, &r);
printf ("%.*s: %s\n",(int)r.length, r.base,
isc_result_totext(sevent->result));
isc_buffer_free (&b);
query->working = ISC_FALSE;
isc_socket_detach (&query->sock);
check_next_lookup(query->lookup);
isc_event_free (&event);
return;
}
b = ISC_LIST_HEAD(sevent->bufferlist);
ISC_LIST_DEQUEUE (sevent->bufferlist, &query->lengthbuf, link);
length = isc_buffer_getuint16(b);
if (length > COMMSIZE)
fatal ("Length was longer than I can handle!");
/* XXXMWS Fix the above. */
/* Even though the buffer was already init'ed, we need
to redo it now, to force the length we want. */
isc_buffer_invalidate (&query->recvbuf);
isc_buffer_init(&query->recvbuf, query->recvspace,
length, ISC_BUFFERTYPE_BINARY);
ENSURE (ISC_LIST_EMPTY (query->recvlist));
ISC_LIST_ENQUEUE (query->recvlist, &query->recvbuf, link);
result = isc_socket_recvv (query->sock, &query->recvlist,
length, task, recv_done,
query);
check_result (result, "isc_socket_recvv");
#ifdef DEBUG
printf ("Resubmitted request with length %d\n",length);
#endif
isc_event_free (&event);
}
static void
launch_next_query(dig_query_t *query) {
isc_result_t result;
if (!query->lookup->pending) {
#ifdef DEBUG
puts ("Ignoring launch_next_query because !pending.");
#endif
isc_socket_detach (&query->sock);
query->working = ISC_FALSE;
query->waiting_connect = ISC_FALSE;
check_next_lookup (query->lookup);
return;
}
isc_buffer_putuint16(&query->slbuf, query->lookup->sendbuf.used);
ISC_LIST_ENQUEUE(query->sendlist, &query->slbuf, link);
ISC_LIST_ENQUEUE(query->sendlist, &query->lookup->sendbuf, link);
ISC_LIST_ENQUEUE(query->lengthlist