Index: adns/INSTALL
diff -u adns/INSTALL:1.7 adns/INSTALL:1.10
--- adns/INSTALL:1.7	Sun May  7 23:37:18 2000
+++ adns/INSTALL	Wed Aug  9 16:40:10 2000
@@ -17,9 +17,9 @@
 In particular, the build system assumes that you have ELF shared
 libraries.  If you don't then please don't send me patches to support
 your kind of shared libraries, and don't send me patches to use
-libtool.  I'm not interested in supporting non-ELF shared libraries.
-However, if you send me an appropriate patch I'd be willing to make it
-easy or automatic to disable the ELF shared library arrangements.
+libtool.  I'm not interested in supporting non-ELF shared libraries,
+and I dislike libtool.  If you do not have ELF shared libraries then
+please use the --disable-shared configure option.
 
 The adnsresfilter utility uses `tsearch' from the C library (a la SVID
 and X/Open).  If your C library doesn't have tsearch you will find
@@ -75,7 +75,7 @@
 General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with userv as the file COPYING; if not, email me at the address
+along with adns as the file COPYING; if not, email me at the address
 above or write to the Free Software Foundation, 59 Temple Place -
 Suite 330, Boston, MA 02111-1307, USA.
 
Index: adns/Makefile.in
diff -u adns/Makefile.in:1.19 adns/Makefile.in:1.22
--- adns/Makefile.in:1.19	Sun May  7 23:37:18 2000
+++ adns/Makefile.in	Wed Aug  9 16:55:49 2000
@@ -1,7 +1,7 @@
 # Makefile - top-level Makefile
 #  
 #  This file is
-#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#    Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
 #
 #  It is part of adns, which is
 #    Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
@@ -21,11 +21,18 @@
 #  along with this program; if not, write to the Free Software Foundation,
 #  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
 
-DISTVERSION=	0.8
+DISTVERSION=	0.9
 srcdir=		@srcdir@
 VPATH=		@srcdir@
+
+ENABLE_DYNAMIC=	@ENABLE_DYNAMIC@
+ifeq ($(ENABLE_DYNAMIC),elf)
+SUBDIRS_DYNAMIC=dynamic
+else
+SUBDIRS_DYNAMIC=
+endif
 
-SUBDIRS= src dynamic client regress
+SUBDIRS= src $(SUBDIRS_DYNAMIC) client regress
 
 all install uninstall clean distclean mostlyclean maintainer-clean distprep:
 	set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done
Index: adns/TODO
diff -u adns/TODO:1.9 adns/TODO:1.10
--- adns/TODO:1.9	Sat Aug 14 19:55:08 1999
+++ adns/TODO	Wed Jun 28 00:16:02 2000
@@ -1,15 +1,10 @@
-INVESTIGATE:
-* coredump in adnstest_s
-
-BUGS:
-* adns_qf_quoteok_cname should be the default.
-
 WISHLIST:
-* Easy way to make a reverse query.
 * Make timeouts configurable.
 * `fake' reverse queries (give nnn.nnn.nnn.nnn either always or on error)
 * `fake' forward queries (allow nnn.nnn.nnn.nnn -> A)
 * DNSSEC compatibility - be able to retreive KEY and SIG RRs
 * DNSSEC minimum functionality - ignore Additional when AD set.
 * DNSSEC functionality - provide security ?
-* Easy-to-use scripting query tool
+* Test cancellation in regression tests.
+* IPv6 name<->address translation - but which version ??
+* IPv6 transport.
Index: adns/changelog
diff -u adns/changelog:1.100 adns/changelog:1.116
--- adns/changelog:1.100	Sun May  7 23:37:18 2000
+++ adns/changelog	Wed Aug  9 16:59:58 2000
@@ -1,3 +1,35 @@
+adns (0.9) unstable; urgency=high
+
+  Bug fixes:
+  * Don't make _processany always kill the TCP connection with the message
+    `TCP connection failed: poll/select: exceptional condition detected'.
+  * Call MEM_ROUND in __transfer_interim (avoids assert fail
+    `qu->interim_allocd>=0' on some platforms eg 64 bit).
+  * adnsresfilter doesn't resolve textual prefixes of addresses (eg,
+    10.0.0.1 out of 10.0.0.123) if input happens to block at that point.
+  * Do not spin if TCP connection blocks for writing (and add test case).
+  * Fail queries if TCP dies repeatedly, rather than retrying many times.
+  * Do not abort in a couple of places if TCP unexpectedly broken.
+  * Do not free something twice if query fails and is then cancelled.
+
+  Portability/compilation fixes:
+  * Move `extern "C" {' to after #include <...>'s.
+  * Pass LDFLAGS from configure on to ld via settings.make.in.
+  * make clean deletes *.so and *.so.* files.
+  * New --disable-dynamic configure option for non-ELF systems.
+  * Use AC_PROG_INSTALL (=> perhaps install-sh), to avoid bad `install'.
+
+  Minor improvements:
+  * Do not print warning if sendto() gives EAGAIN.
+  * adnsresfilter default timeout changed to 1000ms.
+  * m1test script can invoke `hrecord' differently.
+  * regress/output-<case>.report file contains more useful info.
+  * TODO list and other docs updated slightly.
+  * Referrals with RD+RA set, or RCODE=Refused, don't generate warnings,
+    just debug messages.  BIND does this kind of thing all the time.
+
+ -- Ian Jackson <ian@davenant.greenend.org.uk>  Wed,  9 Aug 2000 16:59:28 +0100
+
 adns (0.8) BETA; urgency=medium
 
   Bugfixes:
Index: adns/configure
diff -u adns/configure:1.10 adns/configure:1.12
--- adns/configure:1.10	Wed Nov 24 16:57:32 1999
+++ adns/configure	Wed Aug  9 16:26:54 2000
@@ -11,6 +11,9 @@
 ac_help=
 ac_default_prefix=/usr/local
 # Any additions from configure.in:
+ac_help="$ac_help
+  --disable-dynamic       use static linking
+  --enable-dynamic[=elf]  create and use ELF dynamic library (default)"
 
 # Initialize some variables set by options.
 # The variables have the same names as the options, with
@@ -519,10 +522,37 @@
 
 
 
+
+echo $ac_n "checking whether you requested dynamic linking""... $ac_c" 1>&6
+echo "configure:528: checking whether you requested dynamic linking" >&5
+
+# Check whether --enable-dynamic or --disable-dynamic was given.
+if test "${enable_dynamic+set}" = set; then
+  enableval="$enable_dynamic"
+  	case "$enableval" in
+	elf|yes)
+		ENABLE_DYNAMIC=elf
+		echo "$ac_t""yes (ELF)" 1>&6
+		;;
+	no)	ENABLE_DYNAMIC=no
+		echo "$ac_t""no" 1>&6
+		;;
+	*)	{ echo "configure: error: "invalid value $enableval for --enable-dynamic, try yes or elf"" 1>&2; exit 1; }
+		;;
+	esac
+
+else
+  
+		ENABLE_DYNAMIC=yes
+		echo "$ac_t""yes, by default" 1>&6
+
+fi
+
+
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:526: checking for $ac_word" >&5
+echo "configure:556: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -551,7 +581,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:555: checking for $ac_word" >&5
+echo "configure:585: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -599,7 +629,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:603: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:633: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -609,11 +639,11 @@
 cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext <<EOF
-#line 613 "configure"
+#line 643 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -633,12 +663,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:637: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:667: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:642: checking whether we are using GNU C" >&5
+echo "configure:672: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -647,7 +677,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:651: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:681: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -662,7 +692,7 @@
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:666: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:696: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -690,7 +720,7 @@
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:694: checking how to run the C preprocessor" >&5
+echo "configure:724: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -705,13 +735,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 709 "configure"
+#line 739 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:715: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -722,13 +752,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 726 "configure"
+#line 756 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -753,7 +783,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:757: checking for $ac_word" >&5
+echo "configure:787: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -779,16 +809,95 @@
   echo "$ac_t""no" 1>&6
 fi
 
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:843: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    # Account for people who put trailing slashes in PATH elements.
+    case "$ac_dir/" in
+    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    *)
+      # OSF1 and SCO ODT 3.0 have their own names for install.
+      for ac_prog in ginstall installbsd scoinst install; do
+        if test -f $ac_dir/$ac_prog; then
+	  if test $ac_prog = install &&
+            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    # OSF/1 installbsd also uses dspmsg, but is usable.
+	    :
+	  else
+	    ac_cv_path_install="$ac_dir/$ac_prog -c"
+	    break 2
+	  fi
+	fi
+      done
+      ;;
+    esac
+  done
+  IFS="$ac_save_IFS"
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL="$ac_cv_path_install"
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL="$ac_install_sh"
+  fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
 for ac_func in poll
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:787: checking for $ac_func" >&5
+echo "configure:896: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 792 "configure"
+#line 901 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -811,7 +920,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -837,12 +946,12 @@
 
 
  echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:841: checking for socket" >&5
+echo "configure:950: checking for socket" >&5
 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 846 "configure"
+#line 955 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -865,7 +974,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_socket=yes"
 else
@@ -884,7 +993,7 @@
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:888: checking for socket in -lsocket" >&5
+echo "configure:997: checking for socket in -lsocket" >&5
 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -892,7 +1001,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 896 "configure"
+#line 1005 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -903,7 +1012,7 @@
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -939,12 +1048,12 @@
 
 
  echo $ac_n "checking for inet_ntoa""... $ac_c" 1>&6
-echo "configure:943: checking for inet_ntoa" >&5
+echo "configure:1052: checking for inet_ntoa" >&5
 if eval "test \"`echo '$''{'ac_cv_func_inet_ntoa'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 948 "configure"
+#line 1057 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char inet_ntoa(); below.  */
@@ -967,7 +1076,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_inet_ntoa=yes"
 else
@@ -986,7 +1095,7 @@
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for inet_ntoa in -lnsl""... $ac_c" 1>&6
-echo "configure:990: checking for inet_ntoa in -lnsl" >&5
+echo "configure:1099: checking for inet_ntoa in -lnsl" >&5
 ac_lib_var=`echo nsl'_'inet_ntoa | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -994,7 +1103,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 998 "configure"
+#line 1107 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1005,7 +1114,7 @@
 inet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:1009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1043,12 +1152,12 @@
 PROGS_IF_TSEARCH=adnsresfilter
 
 echo $ac_n "checking for tsearch""... $ac_c" 1>&6
-echo "configure:1047: checking for tsearch" >&5
+echo "configure:1156: checking for tsearch" >&5
 if eval "test \"`echo '$''{'ac_cv_func_tsearch'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1052 "configure"
+#line 1161 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char tsearch(); below.  */
@@ -1071,7 +1180,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_tsearch=yes"
 else
@@ -1098,13 +1207,13 @@
 
 
 echo $ac_n "checking for INADDR_LOOPBACK""... $ac_c" 1>&6
-echo "configure:1102: checking for INADDR_LOOPBACK" >&5
+echo "configure:1211: checking for INADDR_LOOPBACK" >&5
 if eval "test \"`echo '$''{'adns_cv_decl_inaddrloopback'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
  cat > conftest.$ac_ext <<EOF
-#line 1108 "configure"
+#line 1217 "configure"
 #include "confdefs.h"
 
 #include <sys/socket.h>
@@ -1117,7 +1226,7 @@
  
 ; return 0; }
 EOF
-if { (eval echo configure:1121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1230: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   adns_cv_decl_inaddrloopback=yes
 else
@@ -1135,17 +1244,17 @@
  echo "$ac_t""not in standard headers, urgh..." 1>&6
  ac_safe=`echo "rpc/types.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for rpc/types.h""... $ac_c" 1>&6
-echo "configure:1139: checking for rpc/types.h" >&5
+echo "configure:1248: checking for rpc/types.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1144 "configure"
+#line 1253 "configure"
 #include "confdefs.h"
 #include <rpc/types.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1178,12 +1287,12 @@
 
 
  echo $ac_n "checking for inet_aton""... $ac_c" 1>&6
-echo "configure:1182: checking for inet_aton" >&5
+echo "configure:1291: checking for inet_aton" >&5
 if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1187 "configure"
+#line 1296 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char inet_aton(); below.  */
@@ -1206,7 +1315,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_inet_aton=yes"
 else
@@ -1225,7 +1334,7 @@
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6
-echo "configure:1229: checking for inet_aton in -lresolv" >&5
+echo "configure:1338: checking for inet_aton in -lresolv" >&5
 ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1233,7 +1342,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1237 "configure"
+#line 1346 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1244,7 +1353,7 @@
 inet_aton()
 ; return 0; }
 EOF
-if { (eval echo configure:1248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1278,20 +1387,20 @@
 
  
  echo $ac_n "checking __attribute__((,,))""... $ac_c" 1>&6
-echo "configure:1282: checking __attribute__((,,))" >&5
+echo "configure:1391: checking __attribute__((,,))" >&5
  if eval "test \"`echo '$''{'adns_cv_c_attribute_supported'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
   cat > conftest.$ac_ext <<EOF
-#line 1288 "configure"
+#line 1397 "configure"
 #include "confdefs.h"
 
 int main() {
 extern int testfunction(int x) __attribute__((,,))
 ; return 0; }
 EOF
-if { (eval echo configure:1295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   adns_cv_c_attribute_supported=yes
 else
@@ -1313,20 +1422,20 @@
 
    
  echo $ac_n "checking __attribute__((noreturn))""... $ac_c" 1>&6
-echo "configure:1317: checking __attribute__((noreturn))" >&5
+echo "configure:1426: checking __attribute__((noreturn))" >&5
  if eval "test \"`echo '$''{'adns_cv_c_attribute_noreturn'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
   cat > conftest.$ac_ext <<EOF
-#line 1323 "configure"
+#line 1432 "configure"
 #include "confdefs.h"
 
 int main() {
 extern int testfunction(int x) __attribute__((noreturn))
 ; return 0; }
 EOF
-if { (eval echo configure:1330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1439: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   adns_cv_c_attribute_noreturn=yes
 else
@@ -1353,20 +1462,20 @@
 
    
  echo $ac_n "checking __attribute__((const))""... $ac_c" 1>&6
-echo "configure:1357: checking __attribute__((const))" >&5
+echo "configure:1466: checking __attribute__((const))" >&5
  if eval "test \"`echo '$''{'adns_cv_c_attribute_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
   cat > conftest.$ac_ext <<EOF
-#line 1363 "configure"
+#line 1472 "configure"
 #include "confdefs.h"
 
 int main() {
 extern int testfunction(int x) __attribute__((const))
 ; return 0; }
 EOF
-if { (eval echo configure:1370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1479: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   adns_cv_c_attribute_const=yes
 else
@@ -1393,20 +1502,20 @@
 
    
  echo $ac_n "checking __attribute__((format...))""... $ac_c" 1>&6
-echo "configure:1397: checking __attribute__((format...))" >&5
+echo "configure:1506: checking __attribute__((format...))" >&5
  if eval "test \"`echo '$''{'adns_cv_attribute_format'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
   cat > conftest.$ac_ext <<EOF
-#line 1403 "configure"
+#line 1512 "configure"
 #include "confdefs.h"
 
 int main() {
 extern int testfunction(char *y, ...) __attribute__((format(printf,1,2)))
 ; return 0; }
 EOF
-if { (eval echo configure:1410: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1519: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   adns_cv_attribute_format=yes
 else
@@ -1563,6 +1672,7 @@
 done
 
 ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
 
 trap 'rm -fr `echo "settings.make Makefile
 	src/Makefile client/Makefile dynamic/Makefile regress/Makefile
@@ -1596,9 +1706,12 @@
 s%@oldincludedir@%$oldincludedir%g
 s%@infodir@%$infodir%g
 s%@mandir@%$mandir%g
+s%@ENABLE_DYNAMIC@%$ENABLE_DYNAMIC%g
 s%@CC@%$CC%g
 s%@CPP@%$CPP%g
 s%@RANLIB@%$RANLIB%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@PROGS_HAVE_TSEARCH@%$PROGS_HAVE_TSEARCH%g
 s%@WARNS@%$WARNS%g
 s%@SHLIBCC@%$SHLIBCC%g
@@ -1686,6 +1799,10 @@
     top_srcdir="$ac_dots$ac_given_srcdir" ;;
   esac
 
+  case "$ac_given_INSTALL" in
+  [/$]*) INSTALL="$ac_given_INSTALL" ;;
+  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+  esac
 
   echo creating "$ac_file"
   rm -f "$ac_file"
@@ -1701,6 +1818,7 @@
 s%@configure_input@%$configure_input%g
 s%@srcdir@%$srcdir%g
 s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
 fi; done
 rm -f conftest.s*
Index: adns/configure.in
diff -u adns/configure.in:1.12 adns/configure.in:1.15
--- adns/configure.in:1.12	Sun May  7 23:37:18 2000
+++ adns/configure.in	Wed Aug  9 16:55:49 2000
@@ -1,7 +1,7 @@
 # configure.in - input to autoconf
 #  
 #  This file is
-#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#    Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
 #
 #  It is part of adns, which is
 #    Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
@@ -23,9 +23,33 @@
 
 AC_INIT(src/adns.h)
 AC_CONFIG_HEADER(src/config.h)
+
+AC_MSG_CHECKING(whether you requested dynamic linking)
+AC_SUBST(ENABLE_DYNAMIC)
+AC_ARG_ENABLE(dynamic,
+[  --disable-dynamic       use static linking
+  --enable-dynamic[=elf]  create and use ELF dynamic library (default)],
+[	case "$enableval" in
+	elf|yes)
+		ENABLE_DYNAMIC=elf
+		AC_MSG_RESULT([yes (ELF)])
+		;;
+	no)	ENABLE_DYNAMIC=no
+		AC_MSG_RESULT(no)
+		;;
+	*)	AC_MSG_ERROR(
+["invalid value $enableval for --enable-dynamic, try yes or elf"])
+		;;
+	esac
+],[
+		ENABLE_DYNAMIC=yes
+		AC_MSG_RESULT([yes, by default])
+])
+
 AC_PROG_CC
 AC_PROG_CPP
 AC_PROG_RANLIB
+AC_PROG_INSTALL
 
 AC_CHECK_FUNCS(poll)
 ADNS_C_GETFUNC(socket,socket)
Index: adns/settings.make.in
diff -u adns/settings.make.in:1.13 adns/settings.make.in:1.16
--- adns/settings.make.in:1.13	Sun May  7 23:37:18 2000
+++ adns/settings.make.in	Wed Aug  9 16:55:49 2000
@@ -2,7 +2,7 @@
 #  used by autoconf/configure to generate settings.make
 #  
 #  This file is
-#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#    Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
 #
 #  It is part of adns, which is
 #    Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
@@ -30,8 +30,10 @@
 
 CC=		@CC@
 CFLAGS=		$(AUTOCFLAGS) $(WARNS) $(WERROR) $(DIRCFLAGS) $(XCFLAGS)
+LDFLAGS=	$(AUTOLDFLAGS) $(DIRLDFLAGS) $(XLDFLAGS)
 LDLIBS=		@LIBS@ $(XLIBS)
 AUTOCFLAGS=	@CFLAGS@
+AUTOLDFLAGS=	@LDFLAGS@
 WARNS=		@WARNS@
 #WERROR=	-Werror
 
@@ -50,14 +52,14 @@
 lib_dir=	$(exec_prefix)/lib
 include_dir=	$(prefix)/include
 
-INSTALL=		install -c
+INSTALL=		@INSTALL@
 INSTALL_PROGRAM=	$(INSTALL) -m 755 $(INSTALL_PROGRAM_FLAGS)
 INSTALL_DATA=		$(INSTALL) -m 644
 
 all:			$(TARGETS)
 
 clean mostlyclean:
-		rm -f *.o *.tmp*
+		rm -f *.o *.tmp* *.so *.so.*
 
 distclean:		clean
 		rm -f $(TARGETS) *~ ./#*# core *.orig *.rej Makefile
Index: adns/client/Makefile.in
diff -u adns/client/Makefile.in:1.21 adns/client/Makefile.in:1.23
--- adns/client/Makefile.in:1.21	Sun May  7 23:37:18 2000
+++ adns/client/Makefile.in	Wed Aug  9 16:55:49 2000
@@ -1,7 +1,7 @@
 # client/Makefile - client program(s) Makefile
 # 
 #  This file is
-#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#    Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
 #
 #  It is part of adns, which is
 #    Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
@@ -24,14 +24,27 @@
 srcdir=		@srcdir@
 VPATH=		@srcdir@
 
-PROGS_SYSDEP=		@PROGS_HAVE_TSEARCH@
+PROGS_SYSDEP=	@PROGS_HAVE_TSEARCH@
+ENABLE_DYNAMIC=	@ENABLE_DYNAMIC@
 
 PROGRAMS=	adnstest adnslogres adnshost $(PROGS_SYSDEP)
 PROGRAMS_LOCAL=	fanftest
 PROGRAMS_ALL=	$(PROGRAMS) $(PROGRAMS_LOCAL)
 
+STATIC_LIB=	$(ADNSDIR)/libadns.a
+
+ifeq ($(ENABLE_DYNAMIC),elf)
+DYNAMIC_DEP=	$(srcdir)/../dynamic/$(SHLIBFILE)
+DYNAMIC_LINK=	-L$(srcdir)/../dynamic -ladns
+DYNAMIC_SUFFIX=	_s
+else
+DYNAMIC_DEP=	$(STATIC_LIB)
+DYNAMIC_LINK=	$(STATIC_LIB)
+DYNAMIC_SUFFIX=
+endif
+
 TARG_INSTALL=	$(PROGRAMS)
-TARG_LOCAL=	$(addsuffix _s, $(PROGRAMS_ALL))
+TARG_LOCAL=	$(addsuffix $(DYNAMIC_SUFFIX), $(PROGRAMS_ALL))
 TARGETS=	$(TARG_LOCAL) $(TARG_INSTALL)
 include		$(srcdir)/../settings.make
 
@@ -42,10 +55,6 @@
 ALL_OBJS=	$(ADH_OBJS) $(TARG_OBJS)
 
 ADNSDIR=	$(srcdir)/../src/
-
-STATIC_LIB=	$(ADNSDIR)/libadns.a
-DYNAMIC_DEP=	$(srcdir)/../dynamic/$(SHLIBFILE)
-DYNAMIC_LINK=	-L$(srcdir)/../dynamic -ladns
 
 all:		$(TARGETS)
 
Index: adns/client/adnsresfilter.c
diff -u adns/client/adnsresfilter.c:1.7 adns/client/adnsresfilter.c:1.8
--- adns/client/adnsresfilter.c:1.7	Sun May  7 23:37:18 2000
+++ adns/client/adnsresfilter.c	Sun May 21 19:34:18 2000
@@ -50,7 +50,7 @@
 };
 
 static int bracket, forever, address;
-static unsigned long timeout=100;
+static unsigned long timeout= 1000;
 static adns_rrtype rrt= adns_r_ptr;
 
 static int outblocked, inputeof;
@@ -369,7 +369,6 @@
       if (!bracket && !isalnum(c)) startaddr();
     }
   }
-  if (cbyte==3 && inbyte>0 && !bracket) procaddr();
 }
 
 static void startup(void) {
Index: adns/client/adnstest.c
diff -u adns/client/adnstest.c:1.40 adns/client/adnstest.c:1.41
--- adns/client/adnstest.c:1.40	Sun May  7 23:37:18 2000
+++ adns/client/adnstest.c	Wed Jun 28 00:01:42 2000
@@ -232,6 +232,8 @@
   }
   if (r) failure_errno("init",r);
 
+  setvbuf(stdout,0,_IOLBF,0);
+  
   for (qi=0; qi<qc; qi++) {
     fdom_split(fdomlist[qi],&domain,&qflags,ownflags,sizeof(ownflags));
     if (!consistsof(ownflags,"a")) usageerr("unknown ownqueryflag");
Index: adns/regress/case-norecurse.out
diff -u adns/regress/case-norecurse.out:1.6 adns/regress/case-norecurse.out:1.7
--- adns/regress/case-norecurse.out:1.6	Sat Oct 16 20:04:07 1999
+++ adns/regress/case-norecurse.out	Sun May 21 18:02:54 2000
@@ -6,17 +6,14 @@
 4.204.50.158.in-addr.arpa flags 0 type 12 PTR(raw) submitted
 4.204.50.158.in-addr.arpa flags 0 type 13adns debug: TCP connected (NS=172.18.45.6)
  HINFO(-) submitted
-4.204.50.158.in-addr.arpa flags 0 type 15adns warning: TCP connection failed: poll/select: exceptional condition detected (NS=172.18.45.6)
- MX(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 15 MX(raw) submitted
 4.204.50.158.in-addr.arpa flags 0 type 16 TXT(-) submitted
 4.204.50.158.in-addr.arpa flags 0 type 17 RP(raw) submitted
 4.204.50.158.in-addr.arpa flags 0 type 65537 A(addr) submitted
 4.204.50.158.in-addr.arpa flags 0 type 65538 NS(+addr) submitted
 4.204.50.158.in-addr.arpa flags 0 type 65548 PTR(checked) submitted
-4.204.50.158.in-addr.arpa flags 0 type 65551adns debug: TCP connected (NS=172.18.45.6)
- MX(+addr) submitted
-4.204.50.158.in-addr.arpa flags 0 type 131078adns warning: TCP connection failed: poll/select: exceptional condition detected (NS=172.18.45.6)
- SOA(822) submitted
+4.204.50.158.in-addr.arpa flags 0 type 65551 MX(+addr) submitted
+4.204.50.158.in-addr.arpa flags 0 type 131078 SOA(822) submitted
 4.204.50.158.in-addr.arpa flags 0 type 131089adns debug: reply not found, id 3141, query owner ns2.afpdoc.com (NS=172.18.45.6)
 adns debug: reply not found, id 3142, query owner ns2.afp-notes.com (NS=172.18.45.6)
 adns debug: reply not found, id 3143, query owner ns2.afp-domino.com (NS=172.18.45.6)
Index: adns/regress/case-norecurse.sys
diff -u adns/regress/case-norecurse.sys:1.5 adns/regress/case-norecurse.sys:1.6
--- adns/regress/case-norecurse.sys:1.5	Tue Oct 12 22:35:06 1999
+++ adns/regress/case-norecurse.sys	Sun May 21 18:02:54 2000
@@ -161,10 +161,7 @@
  +0.002445
  read fd=5 buflen=686
  read=EAGAIN
- +0.003282
- close fd=5
- close=OK
- +0.000529
+ +0.003811
  sendto fd=4 addr=172.18.45.6:53
      31260100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
      72046172 70610000 100001.
@@ -177,7 +174,10 @@
  +0.000256
  recvfrom fd=4 buflen=512 *addrlen=16
  recvfrom=EAGAIN
- +0.000116
+ +0.000115
+ read fd=5 buflen=686
+ read=EAGAIN
+ +0.000001
  sendto fd=4 addr=172.18.45.6:53
      31270100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
      72046172 70610000 110001.
@@ -190,7 +190,10 @@
  +0.000259
  recvfrom fd=4 buflen=512 *addrlen=16
  recvfrom=EAGAIN
- +0.000113
+ +0.000112
+ read fd=5 buflen=686
+ read=EAGAIN
+ +0.000001
  sendto fd=4 addr=172.18.45.6:53
      31280100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
      72046172 70610000 010001.
@@ -203,7 +206,10 @@
  +0.000259
  recvfrom fd=4 buflen=512 *addrlen=16
  recvfrom=EAGAIN
- +0.000125
+ +0.000124
+ read fd=5 buflen=686
+ read=EAGAIN
+ +0.000001
  sendto fd=4 addr=172.18.45.6:53
      31290100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
      72046172 70610000 020001.
@@ -216,7 +222,10 @@
  +0.000262
  recvfrom fd=4 buflen=512 *addrlen=16
  recvfrom=EAGAIN
- +0.000124
+ +0.000123
+ read fd=5 buflen=686
+ read=EAGAIN
+ +0.000001
  sendto fd=4 addr=172.18.45.6:53
      312a0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
      72046172 70610000 0c0001.
@@ -240,22 +249,18 @@
      6dc03fc0 0c000c00 01000130 7c000704 6e657773 c196c00c 000c0001 0001307c
      0014036e 73320a69 6d616765 666f7275 6d02746d c07cc00c 000c0001 0001307c
      0007046e 657773c1 c6.
- +0.001723
- socket type=SOCK_STREAM
- socket=5
- +0.000993
- fcntl fd=5 cmd=F_GETFL
- fcntl=~O_NONBLOCK&...
- +0.000044
- fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
- fcntl=OK
- +0.000039
- connect fd=5 addr=172.18.45.6:53
- connect=EINPROGRESS
- +0.000436
+ +0.001724
+ write fd=5
+     002b312a 01000001 00000000 00000134 03323034 02353003 31353807 696e2d61
+     64647204 61727061 00000c00 01.
+ write=45
+ +0.001513
  recvfrom fd=4 buflen=512 *addrlen=16
  recvfrom=EAGAIN
- +0.000079
+ +0.000078
+ read fd=5 buflen=686
+ read=EAGAIN
+ +0.000001
  sendto fd=4 addr=172.18.45.6:53
      312b0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
      72046172 70610000 0f0001.
@@ -269,14 +274,9 @@
  recvfrom fd=4 buflen=512 *addrlen=16
  recvfrom=EAGAIN
  +0.000118
- read fd=5 buflen=1
+ read fd=5 buflen=686
  read=EAGAIN
- +0.000068
- write fd=5
-     002b312a 01000001 00000000 00000134 03323034 02353003 31353807 696e2d61
-     64647204 61727061 00000c00 01.
- write=45
- +0.001361
+ +0.001429
  sendto fd=4 addr=172.18.45.6:53
      312c0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
      72046172 70610000 060001.
@@ -425,10 +425,7 @@
  +0.001187
  read fd=5 buflen=686
  read=EAGAIN
- +0.000096
- close fd=5
- close=OK
- +0.000598
+ +0.000694
  sendto fd=4 addr=172.18.45.6:53
      31440100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
      72046172 70610000 110001.
@@ -616,8 +613,11 @@
  +0.000317
  recvfrom fd=4 buflen=512 *addrlen=16
  recvfrom=EAGAIN
- +0.000116
- select max=5 rfds=[4] wfds=[] efds=[] to=1.920611
+ +0.000001
+ read fd=5 buflen=686
+ read=EAGAIN
+ +0.000115
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.920609
  select=1 rfds=[4] wfds=[] efds=[]
  +1.-754319
  recvfrom fd=4 buflen=512 *addrlen=16
@@ -631,3 +631,6 @@
  close fd=4
  close=OK
  +0.000208
+ close fd=5
+ close=OK
+ +0.000001
Index: adns/regress/case-tcpallfail.out
diff -u /dev/null adns/regress/case-tcpallfail.out:1.1
--- /dev/null	Wed Aug  9 17:05:17 2000
+++ adns/regress/case-tcpallfail.out	Wed Jun 28 00:01:42 2000
@@ -0,0 +1,34 @@
+adns debug: using nameserver 172.18.45.2
+test.iwj.relativity.greenend.org.uk. flags 2 type 1 A(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 2 NS(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 5 CNAME(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 6 SOA(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 12 PTR(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 13 HINFO(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 15 MX(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 16 TXT(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 17 RP(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65537 A(addr) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65538 NS(+addr) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65548 PTR(checked) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65551 MX(+addr) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 131078 SOA(822) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 131089 RP(822) submitted
+adns warning: TCP connection failed: connect/read: Connection refused (NS=172.18.45.2)
+adns warning: TCP connection failed: connect/read: Connection refused (NS=172.18.45.2)
+test.iwj.relativity.greenend.org.uk. flags 2 type A(-): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604800
+test.iwj.relativity.greenend.org.uk. flags 2 type NS(raw): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604800
+test.iwj.relativity.greenend.org.uk. flags 2 type CNAME(-): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604800
+test.iwj.relativity.greenend.org.uk. flags 2 type SOA(raw): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604800
+test.iwj.relativity.greenend.org.uk. flags 2 type PTR(raw): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604800
+test.iwj.relativity.greenend.org.uk. flags 2 type HINFO(-): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604800
+test.iwj.relativity.greenend.org.uk. flags 2 type MX(raw): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604800
+test.iwj.relativity.greenend.org.uk. flags 2 type TXT(-): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604800
+test.iwj.relativity.greenend.org.uk. flags 2 type RP(raw): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604800
+test.iwj.relativity.greenend.org.uk. flags 2 type A(addr): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604800
+test.iwj.relativity.greenend.org.uk. flags 2 type NS(+addr): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604800
+test.iwj.relativity.greenend.org.uk. flags 2 type PTR(checked): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604800
+test.iwj.relativity.greenend.org.uk. flags 2 type MX(+addr): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604800
+test.iwj.relativity.greenend.org.uk. flags 2 type SOA(822): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604800
+test.iwj.relativity.greenend.org.uk. flags 2 type RP(822): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604800
+rc=0
Index: adns/regress/case-tcpallfail.sys
diff -u /dev/null adns/regress/case-tcpallfail.sys:1.1
--- /dev/null	Wed Aug  9 17:05:17 2000
+++ adns/regress/case-tcpallfail.sys	Wed Jun 28 00:01:42 2000
@@ -0,0 +1,63 @@
+anarres
+2/test.iwj.relativity.greenend.org.uk.
+ start 962142174.403028
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000120
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000053
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000034
+ socket type=SOCK_STREAM
+ socket=5
+ +0.000479
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000036
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000031
+ connect fd=5 addr=172.18.45.2:53
+ connect=EINPROGRESS
+ +0.000182
+ select max=6 rfds=[4] wfds=[5] efds=[] to=13.999272
+ select=1 rfds=[] wfds=[5] efds=[]
+ +0.000862
+ read fd=5 buflen=1
+ read=ECONNREFUSED
+ +0.000087
+ close fd=5
+ close=OK
+ +0.000109
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000000
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.000103
+ socket type=SOCK_STREAM
+ socket=5
+ +0.000392
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000037
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000030
+ connect fd=5 addr=172.18.45.2:53
+ connect=EINPROGRESS
+ +0.000127
+ select max=6 rfds=[4] wfds=[5] efds=[] to=13.999414
+ select=1 rfds=[] wfds=[5] efds=[]
+ +0.000339
+ read fd=5 buflen=1
+ read=ECONNREFUSED
+ +0.000075
+ close fd=5
+ close=OK
+ +0.000084
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000000
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.000098
+ close fd=4
+ close=OK
+ +0.000879
Index: adns/regress/case-tcpblock.out
diff -u /dev/null adns/regress/case-tcpblock.out:1.1
--- /dev/null	Wed Aug  9 17:05:17 2000
+++ adns/regress/case-tcpblock.out	Wed Jun 28 00:01:42 2000
@@ -0,0 +1,33 @@
+adns debug: using nameserver 172.18.45.2
+test.iwj.relativity.greenend.org.uk. flags 2 type 1 A(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 2 NS(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 5 CNAME(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 6 SOA(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 12 PTR(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 13 HINFO(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 15 MX(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 16 TXT(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 17 RP(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65537 A(addr) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65538 NS(+addr) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65548 PTR(checked) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65551 MX(+addr) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 131078 SOA(822) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 131089 RP(822) submitted
+adns debug: TCP connected (NS=172.18.45.2)
+test.iwj.relativity.greenend.org.uk. flags 2 type A(-): DNS query timed out; nrrs=0; cname=$; owner=$; ttl=604770
+test.iwj.relativity.greenend.org.uk. flags 2 type NS(raw): DNS query timed out; nrrs=0; cname=$; owner=$; ttl=604770
+test.iwj.relativity.greenend.org.uk. flags 2 type CNAME(-): DNS query timed out; nrrs=0; cname=$; owner=$; ttl=604770
+test.iwj.relativity.greenend.org.uk. flags 2 type SOA(raw): DNS query timed out; nrrs=0; cname=$; owner=$; ttl=604770
+test.iwj.relativity.greenend.org.uk. flags 2 type PTR(raw): DNS query timed out; nrrs=0; cname=$; owner=$; ttl=604770
+test.iwj.relativity.greenend.org.uk. flags 2 type HINFO(-): DNS query timed out; nrrs=0; cname=$; owner=$; ttl=604770
+test.iwj.relativity.greenend.org.uk. flags 2 type MX(raw): DNS query timed out; nrrs=0; cname=$; owner=$; ttl=604770
+test.iwj.relativity.greenend.org.uk. flags 2 type TXT(-): DNS query timed out; nrrs=0; cname=$; owner=$; ttl=604770
+test.iwj.relativity.greenend.org.uk. flags 2 type RP(raw): DNS query timed out; nrrs=0; cname=$; owner=$; ttl=604770
+test.iwj.relativity.greenend.org.uk. flags 2 type A(addr): DNS query timed out; nrrs=0; cname=$; owner=$; ttl=604770
+test.iwj.relativity.greenend.org.uk. flags 2 type NS(+addr): DNS query timed out; nrrs=0; cname=$; owner=$; ttl=604770
+test.iwj.relativity.greenend.org.uk. flags 2 type PTR(checked): DNS query timed out; nrrs=0; cname=$; owner=$; ttl=604770
+test.iwj.relativity.greenend.org.uk. flags 2 type MX(+addr): DNS query timed out; nrrs=0; cname=$; owner=$; ttl=604770
+test.iwj.relativity.greenend.org.uk. flags 2 type SOA(822): DNS query timed out; nrrs=0; cname=$; owner=$; ttl=604770
+test.iwj.relativity.greenend.org.uk. flags 2 type RP(822): DNS query timed out; nrrs=0; cname=$; owner=$; ttl=604770
+rc=0
Index: adns/regress/case-tcpblock.sys
diff -u /dev/null adns/regress/case-tcpblock.sys:1.1
--- /dev/null	Wed Aug  9 17:05:17 2000
+++ adns/regress/case-tcpblock.sys	Wed Jun 28 00:01:42 2000
@@ -0,0 +1,114 @@
+anarres
+2/test.iwj.relativity.greenend.org.uk.
+ start 962142246.340485
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000126
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000052
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000035
+ socket type=SOCK_STREAM
+ socket=5
+ +0.000459
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000036
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000031
+ connect fd=5 addr=172.18.45.2:53
+ connect=EINPROGRESS
+ +0.000184
+ select max=6 rfds=[4] wfds=[5] efds=[] to=13.999290
+ select=1 rfds=[] wfds=[5] efds=[]
+ +0.000937
+ read fd=5 buflen=1
+ read=EAGAIN
+ +0.000090
+ write fd=5
+     0035311f 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ write=55
+ +0.000427
+ write fd=5
+     00353120 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 020001.
+ write=55
+ +0.000271
+ write fd=5
+     00353121 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 050001.
+ write=55
+ +0.000429
+ write fd=5
+     00353122 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 060001.
+ write=55
+ +0.000218
+ write fd=5
+     00353123 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0c0001.
+ write=55
+ +0.000212
+ write fd=5
+     00353124 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0d0001.
+ write=55
+ +0.000213
+ write fd=5
+     00353125 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0f0001.
+ write=55
+ +0.000212
+ write fd=5
+     00353126 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 100001.
+ write=55
+ +0.000214
+ write fd=5
+     00353127 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 110001.
+ write=55
+ +0.000494
+ write fd=5
+     00353128 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ write=55
+ +0.000239
+ write fd=5
+     00353129 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 020001.
+ write=55
+ +0.000212
+ write fd=5
+     0035312a 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0c0001.
+ write=55
+ +0.000213
+ write fd=5
+     0035312b 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0f0001.
+ write=55
+ +0.000213
+ write fd=5
+     0035312c 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 060001.
+ write=55
+ +0.000215
+ write fd=5
+     0035312d 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 110001.
+ write=55
+ +0.000236
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=29.994245
+ select=0 rfds=[] wfds=[] efds=[]
+ +30.-04653
+ close fd=4
+ close=OK
+ +0.000943
+ close fd=5
+ close=OK
+ +0.000113
Index: adns/regress/case-tcpblockbrk.out
diff -u /dev/null adns/regress/case-tcpblockbrk.out:1.1
--- /dev/null	Wed Aug  9 17:05:17 2000
+++ adns/regress/case-tcpblockbrk.out	Wed Jun 28 00:01:42 2000
@@ -0,0 +1,35 @@
+adns debug: using nameserver 172.18.45.2
+test.iwj.relativity.greenend.org.uk. flags 2 type 1 A(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 2 NS(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 5 CNAME(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 6 SOA(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 12 PTR(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 13 HINFO(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 15 MX(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 16 TXT(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 17 RP(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65537 A(addr) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65538 NS(+addr) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65548 PTR(checked) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65551 MX(+addr) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 131078 SOA(822) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 131089 RP(822) submitted
+adns debug: TCP connected (NS=172.18.45.2)
+adns warning: TCP connection failed: read: Connection reset by peer (NS=172.18.45.2)
+adns warning: TCP connection failed: connect/read: Connection refused (NS=172.18.45.2)
+test.iwj.relativity.greenend.org.uk. flags 2 type A(-): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604798
+test.iwj.relativity.greenend.org.uk. flags 2 type NS(raw): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604798
+test.iwj.relativity.greenend.org.uk. flags 2 type CNAME(-): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604798
+test.iwj.relativity.greenend.org.uk. flags 2 type SOA(raw): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604798
+test.iwj.relativity.greenend.org.uk. flags 2 type PTR(raw): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604798
+test.iwj.relativity.greenend.org.uk. flags 2 type HINFO(-): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604798
+test.iwj.relativity.greenend.org.uk. flags 2 type MX(raw): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604798
+test.iwj.relativity.greenend.org.uk. flags 2 type TXT(-): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604798
+test.iwj.relativity.greenend.org.uk. flags 2 type RP(raw): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604798
+test.iwj.relativity.greenend.org.uk. flags 2 type A(addr): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604798
+test.iwj.relativity.greenend.org.uk. flags 2 type NS(+addr): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604798
+test.iwj.relativity.greenend.org.uk. flags 2 type PTR(checked): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604798
+test.iwj.relativity.greenend.org.uk. flags 2 type MX(+addr): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604798
+test.iwj.relativity.greenend.org.uk. flags 2 type SOA(822): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604798
+test.iwj.relativity.greenend.org.uk. flags 2 type RP(822): All nameservers failed; nrrs=0; cname=$; owner=$; ttl=604798
+rc=0
Index: adns/regress/case-tcpblockbrk.sys
diff -u /dev/null adns/regress/case-tcpblockbrk.sys:1.1
--- /dev/null	Wed Aug  9 17:05:17 2000
+++ adns/regress/case-tcpblockbrk.sys	Wed Jun 28 00:01:42 2000
@@ -0,0 +1,144 @@
+anarres -0x300
+2/test.iwj.relativity.greenend.org.uk.
+ start 962143388.709150
+ socket type=SOCK_DGRAM
+ socket=5
+ +0.000434
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000462
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000439
+ socket type=SOCK_STREAM
+ socket=6
+ +0.001725
+ fcntl fd=6 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000438
+ fcntl fd=6 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000414
+ connect fd=6 addr=172.18.45.2:53
+ connect=EINPROGRESS
+ +0.000724
+ select max=7 rfds=[5] wfds=[6] efds=[] to=13.996699
+ select=1 rfds=[] wfds=[6] efds=[]
+ +0.003661
+ read fd=6 buflen=1
+ read=EAGAIN
+ +0.000477
+ write fd=6
+     0035311f 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ write=55
+ +0.001553
+ write fd=6
+     00353120 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 020001.
+ write=55
+ +0.001612
+ write fd=6
+     00353121 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 050001.
+ write=55
+ +0.001289
+ write fd=6
+     00353122 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 060001.
+ write=55
+ +0.001204
+ write fd=6
+     00353123 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0c0001.
+ write=55
+ +0.001200
+ write fd=6
+     00353124 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0d0001.
+ write=55
+ +0.001417
+ write fd=6
+     00353125 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0f0001.
+ write=55
+ +0.001199
+ write fd=6
+     00353126 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 100001.
+ write=55
+ +0.001217
+ write fd=6
+     00353127 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 110001.
+ write=55
+ +0.001214
+ write fd=6
+     00353128 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ write=55
+ +0.001259
+ write fd=6
+     00353129 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 020001.
+ write=55
+ +0.001231
+ write fd=6
+     0035312a 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0c0001.
+ write=55
+ +0.001214
+ write fd=6
+     0035312b 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0f0001.
+ write=55
+ +0.001254
+ write fd=6
+     0035312c 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 060001.
+ write=55
+ +0.001443
+ write fd=6
+     0035312d 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 110001.
+ write=55
+ +0.001271
+ select max=7 rfds=[5,6] wfds=[] efds=[6] to=29.972984
+ select=1 rfds=[6] wfds=[] efds=[]
+ +2.-661933
+ read fd=6 buflen=2
+ read=ECONNRESET
+ +0.000519
+ close fd=6
+ close=OK
+ +0.000636
+ select max=6 rfds=[5] wfds=[] efds=[] to=0.000000
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.000702
+ socket type=SOCK_STREAM
+ socket=6
+ +0.001734
+ fcntl fd=6 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000435
+ fcntl fd=6 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000537
+ connect fd=6 addr=172.18.45.2:53
+ connect=EINPROGRESS
+ +0.000608
+ select max=7 rfds=[5] wfds=[6] efds=[] to=13.996686
+ select=1 rfds=[] wfds=[6] efds=[]
+ +0.000977
+ read fd=6 buflen=1
+ read=ECONNREFUSED
+ +0.000450
+ close fd=6
+ close=OK
+ +0.000617
+ select max=6 rfds=[5] wfds=[] efds=[] to=0.000000
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.000689
+ close fd=5
+ close=OK
+ +0.002951
Index: adns/regress/case-tcpblockwr.out
diff -u /dev/null adns/regress/case-tcpblockwr.out:1.1
--- /dev/null	Wed Aug  9 17:05:17 2000
+++ adns/regress/case-tcpblockwr.out	Wed Jun 28 00:01:42 2000
@@ -0,0 +1,105 @@
+adns debug: using nameserver 172.18.45.2
+test.iwj.relativity.greenend.org.uk. flags 2 type 1 A(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 2 NS(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 5 CNAME(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 6 SOA(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 12 PTR(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 13 HINFO(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 15 MX(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 16 TXT(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 17 RP(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65537 A(addr) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65538 NS(+addr) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65548 PTR(checked) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65551 MX(+addr) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 131078 SOA(822) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 131089 RP(822) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 1 A(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 2 NS(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 5 CNAME(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 6 SOA(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 12 PTR(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 13 HINFO(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 15 MX(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 16 TXT(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 17 RP(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65537 A(addr) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65538 NS(+addr) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65548 PTR(checked) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65551 MX(+addr) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 131078 SOA(822) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 131089 RP(822) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 1 A(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 2 NS(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 5 CNAME(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 6 SOA(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 12 PTR(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 13 HINFO(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 15 MX(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 16 TXT(-) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 17 RP(raw) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65537 A(addr) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65538 NS(+addr) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65548 PTR(checked) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 65551 MX(+addr) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 131078 SOA(822) submitted
+test.iwj.relativity.greenend.org.uk. flags 2 type 131089 RP(822) submitted
+adns debug: TCP connected (NS=172.18.45.2)
+test.iwj.relativity.greenend.org.uk. flags 2 type A(-): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type NS(raw): OK; nrrs=1; cname=$; owner=$; ttl=59
+ ns0.relativity.greenend.org.uk
+test.iwj.relativity.greenend.org.uk. flags 2 type CNAME(-): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type SOA(raw): OK; nrrs=1; cname=$; owner=$; ttl=59
+ ns0.relativity.greenend.org.uk hostmaster.relativity.greenend.org.uk 42 3600 120 6604800 60
+test.iwj.relativity.greenend.org.uk. flags 2 type PTR(raw): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type HINFO(-): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type MX(raw): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type TXT(-): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type RP(raw): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type A(addr): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type NS(+addr): OK; nrrs=1; cname=$; owner=$; ttl=59
+ ns0.relativity.greenend.org.uk ok 0 ok "OK" ( INET 172.18.45.6 )
+test.iwj.relativity.greenend.org.uk. flags 2 type PTR(checked): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type MX(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type SOA(822): OK; nrrs=1; cname=$; owner=$; ttl=59
+ ns0.relativity.greenend.org.uk hostmaster@relativity.greenend.org.uk 42 3600 120 6604800 60
+test.iwj.relativity.greenend.org.uk. flags 2 type RP(822): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type A(-): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type NS(raw): OK; nrrs=1; cname=$; owner=$; ttl=59
+ ns0.relativity.greenend.org.uk
+test.iwj.relativity.greenend.org.uk. flags 2 type CNAME(-): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type SOA(raw): OK; nrrs=1; cname=$; owner=$; ttl=59
+ ns0.relativity.greenend.org.uk hostmaster.relativity.greenend.org.uk 42 3600 120 6604800 60
+test.iwj.relativity.greenend.org.uk. flags 2 type PTR(raw): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type HINFO(-): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type MX(raw): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type TXT(-): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type RP(raw): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type A(addr): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type NS(+addr): OK; nrrs=1; cname=$; owner=$; ttl=59
+ ns0.relativity.greenend.org.uk ok 0 ok "OK" ( INET 172.18.45.6 )
+test.iwj.relativity.greenend.org.uk. flags 2 type PTR(checked): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type MX(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type SOA(822): OK; nrrs=1; cname=$; owner=$; ttl=59
+ ns0.relativity.greenend.org.uk hostmaster@relativity.greenend.org.uk 42 3600 120 6604800 60
+test.iwj.relativity.greenend.org.uk. flags 2 type RP(822): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type A(-): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type NS(raw): OK; nrrs=1; cname=$; owner=$; ttl=59
+ ns0.relativity.greenend.org.uk
+test.iwj.relativity.greenend.org.uk. flags 2 type CNAME(-): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type SOA(raw): OK; nrrs=1; cname=$; owner=$; ttl=59
+ ns0.relativity.greenend.org.uk hostmaster.relativity.greenend.org.uk 42 3600 120 6604800 60
+test.iwj.relativity.greenend.org.uk. flags 2 type PTR(raw): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type HINFO(-): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type MX(raw): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type TXT(-): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type RP(raw): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type A(addr): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type NS(+addr): OK; nrrs=1; cname=$; owner=$; ttl=59
+ ns0.relativity.greenend.org.uk ok 0 ok "OK" ( INET 172.18.45.6 )
+test.iwj.relativity.greenend.org.uk. flags 2 type PTR(checked): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type MX(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=59
+test.iwj.relativity.greenend.org.uk. flags 2 type SOA(822): OK; nrrs=1; cname=$; owner=$; ttl=59
+ ns0.relativity.greenend.org.uk hostmaster@relativity.greenend.org.uk 42 3600 120 6604800 60
+test.iwj.relativity.greenend.org.uk. flags 2 type RP(822): No such data; nrrs=0; cname=$; owner=$; ttl=60
+rc=0
Index: adns/regress/case-tcpblockwr.sys
diff -u /dev/null adns/regress/case-tcpblockwr.sys:1.1
--- /dev/null	Wed Aug  9 17:05:17 2000
+++ adns/regress/case-tcpblockwr.sys	Wed Jun 28 00:01:42 2000
@@ -0,0 +1,644 @@
+anarres -0x300
+2/test.iwj.relativity.greenend.org.uk. 2/test.iwj.relativity.greenend.org.uk. 2/test.iwj.relativity.greenend.org.uk.
+ start 962143438.172669
+ socket type=SOCK_DGRAM
+ socket=5
+ +0.000433
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000443
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000409
+ socket type=SOCK_STREAM
+ socket=6
+ +0.001762
+ fcntl fd=6 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000420
+ fcntl fd=6 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000408
+ connect fd=6 addr=172.18.45.2:53
+ connect=EINPROGRESS
+ +0.000689
+ select max=7 rfds=[5] wfds=[6] efds=[] to=13.996721
+ select=1 rfds=[] wfds=[6] efds=[]
+ +0.278976
+ read fd=6 buflen=1
+ read=EAGAIN
+ +0.001048
+ write fd=6
+     0035311f 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ write=55
+ +0.001447
+ write fd=6
+     00353120 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 020001.
+ write=55
+ +0.001424
+ write fd=6
+     00353121 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 050001.
+ write=55
+ +0.001287
+ write fd=6
+     00353122 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 060001.
+ write=55
+ +0.001199
+ write fd=6
+     00353123 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0c0001.
+ write=55
+ +0.001220
+ write fd=6
+     00353124 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0d0001.
+ write=55
+ +0.001189
+ write fd=6
+     00353125 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0f0001.
+ write=55
+ +0.001368
+ write fd=6
+     00353126 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 100001.
+ write=55
+ +0.001220
+ write fd=6
+     00353127 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 110001.
+ write=55
+ +0.001313
+ write fd=6
+     00353128 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ write=55
+ +0.001209
+ write fd=6
+     00353129 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 020001.
+ write=55
+ +0.001192
+ write fd=6
+     0035312a 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0c0001.
+ write=55
+ +0.001192
+ write fd=6
+     0035312b 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0f0001.
+ write=55
+ +0.001214
+ write fd=6
+     0035312c 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 060001.
+ write=55
+ +0.001195
+ write fd=6
+     0035312d 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 110001.
+ write=55
+ +0.001424
+ write fd=6
+     0035312e 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ write=55
+ +0.001226
+ write fd=6
+     0035312f 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 020001.
+ write=55
+ +0.001214
+ write fd=6
+     00353130 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 050001.
+ write=55
+ +0.001202
+ write fd=6
+     00353131 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 060001.
+ write=55
+ +0.001187
+ write fd=6
+     00353132 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0c0001.
+ write=55
+ +0.001207
+ write fd=6
+     00353133 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0d0001.
+ write=55
+ +0.001192
+ write fd=6
+     00353134 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0f0001.
+ write=55
+ +0.001214
+ write fd=6
+     00353135 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 100001.
+ write=55
+ +0.001386
+ write fd=6
+     00353136 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 110001.
+ write=55
+ +0.001215
+ write fd=6
+     00353137 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ write=55
+ +0.001448
+ write fd=6
+     00353138 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 020001.
+ write=55
+ +0.001202
+ write fd=6
+     00353139 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0c0001.
+ write=55
+ +0.001201
+ write fd=6
+     0035313a 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0f0001.
+ write=55
+ +0.001231
+ write fd=6
+     0035313b 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 060001.
+ write=55
+ +0.001197
+ write fd=6
+     0035313c 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 110001.
+ write=55
+ +0.001212
+ write fd=6
+     0035313d 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ write=55
+ +0.001369
+ write fd=6
+     0035313e 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 020001.
+ write=55
+ +0.001212
+ write fd=6
+     0035313f 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 050001.
+ write=55
+ +0.001334
+ write fd=6
+     00353140 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 060001.
+ write=55
+ +0.001212
+ write fd=6
+     00353141 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0c0001.
+ write=55
+ +0.001207
+ write fd=6
+     00353142 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0d0001.
+ write=55
+ +0.001187
+ write fd=6
+     00353143 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0f0001.
+ write=55
+ +0.001186
+ write fd=6
+     00353144 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 100001.
+ write=55
+ +0.001204
+ write fd=6
+     00353145 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 110001.
+ write=55
+ +0.001365
+ write fd=6
+     00353146 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ write=55
+ +0.001254
+ write fd=6
+     00353147 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 020001.
+ write=55
+ +0.001278
+ write fd=6
+     00353148 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0c0001.
+ write=55
+ +0.001207
+ write fd=6
+     00353149 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0f0001.
+ write=55
+ +0.001201
+ write fd=6
+     0035314a 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 060001.
+ write=55
+ +0.001188
+ write fd=6
+     0035314b 01000001 00000000 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 110001.
+ write=30
+ +1.814491
+ select max=7 rfds=[5,6] wfds=[6] efds=[6] to=27.847175
+ select=2 rfds=[6] wfds=[6] efds=[]
+ +5.-217468
+ read fd=6 buflen=2
+ read=OK
+     0082.
+ +0.012764
+ read fd=6 buflen=130
+ read=OK
+     311f8580 00010000 00010000 04746573 74036977 6a0a7265 6c617469 76697479
+     08677265 656e656e 64036f72 6702756b 00000100 01c00c00 06000100 00003c00
+     41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b
+     000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064 c8000000
+     003c.
+ +0.003700
+ read fd=6 buflen=132
+ read=OK
+     00713120 85800001 00010000 00010474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 020001c0 0c000200 01000000
+     3c002003 6e73300a 72656c61 74697669 74790867 7265656e 656e6403 6f726702
+     756b00c0 41000100 01000151 800004ac 122d0600 82312185 80000100 00000100
+     00047465.
+ +0.003001
+ read fd=6 buflen=115
+ read=OK
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000005 0001c00c 00060001 0000003c 0041036e 73300a72 656c6174 69766974
+     79086772 65656e65 6e64036f 72670275 6b000a68 6f73746d 61737465 72c04500
+     00002a00 000e1000 00007800 64c80000 00003c.
+ +0.001128
+ read fd=6 buflen=132
+ read=OK
+     00a03122 85800001 00010001 00010474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 060001c0 0c000600 01000000
+     3c004103 6e73300a 72656c61 74697669 74790867 7265656e 656e6403 6f726702
+     756b000a 686f7374 6d617374 6572c045 0000002a 00000e10 00000078 0064c800
+     0000003c.
+ +0.299749
+ read fd=6 buflen=30
+ read=OK
+     c00c0002 00010000 003c0002 c041c041 00010001 00015180 0004ac12 2d06.
+ +0.000767
+ read fd=6 buflen=162
+ read=OK
+     00823123 85800001 00000001 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0c0001c0 0c000600 01000000
+     3c004103 6e73300a 72656c61 74697669 74790867 7265656e 656e6403 6f726702
+     756b000a 686f7374 6d617374 6572c045 0000002a 00000e10 00000078 0064c800
+     0000003c 00823124 85800001 00000001 00000474 65737403 69776a0a 72656c61
+     7469.
+ +0.001110
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000d00 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003c0082 31258580 00010000 00010000 04746573 74036977 6a0a7265
+     6c617469.
+ +0.000934
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000f00 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003c0082 31268580 00010000 00010000 04746573 74036977 6a0a7265
+     6c617469.
+ +0.001041
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00001000 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003c0082 31278580 00010000 00010000 04746573 74036977 6a0a7265
+     6c617469.
+ +0.000940
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00001100 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003c0082 31288580 00010000 00010000 04746573 74036977 6a0a7265
+     6c617469.
+ +0.001164
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000100 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003c0071 31298580 00010001 00000001 04746573 74036977 6a0a7265
+     6c617469.
+ +0.000955
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000200 01c00c00 02000100
+     00003c00 20036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 00c04100 01000100 01518000 04ac122d 06008231 2a858000 01000000
+     01000004 74657374 0369776a 0a72656c 61746976 69747908 67726565 6e656e64
+     036f7267.
+ +0.001035
+ read fd=6 buflen=115
+ read=OK
+     02756b00 000c0001 c00c0006 00010000 003c0041 036e7330 0a72656c 61746976
+     69747908 67726565 6e656e64 036f7267 02756b00 0a686f73 746d6173 746572c0
+     45000000 2a00000e 10000000 780064c8 00000000 3c008231 2b858000 01000000
+     01000004 74657374 0369776a 0a72656c 617469.
+ +0.000978
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000f00 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003c00a0 312c8580 00010001 00010001 04746573 74036977 6a0a7265
+     6c617469.
+ +0.000953
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000600 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003cc00c 00020001 0000003c 0002c041 c0410001 00010001 51800004
+     ac122d06.
+ +0.002102
+ read fd=6 buflen=162
+ read=OK
+     0082312d 85800001 00000001 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 110001c0 0c000600 01000000
+     3c004103 6e73300a 72656c61 74697669 74790867 7265656e 656e6403 6f726702
+     756b000a 686f7374 6d617374 6572c045 0000002a 00000e10 00000078 0064c800
+     0000003c 0082312e 85800001 00000001 00000474 65737403 69776a0a 72656c61
+     7469.
+ +0.001126
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000100 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003c0071 312f8580 00010001 00000001 04746573 74036977 6a0a7265
+     6c617469.
+ +0.000976
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000200 01c00c00 02000100
+     00003c00 20036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 00c04100 01000100 01518000 04ac122d 06008231 30858000 01000000
+     01000004 74657374 0369776a 0a72656c 61746976 69747908 67726565 6e656e64
+     036f7267.
+ +0.000930
+ read fd=6 buflen=115
+ read=OK
+     02756b00 00050001 c00c0006 00010000 003c0041 036e7330 0a72656c 61746976
+     69747908 67726565 6e656e64 036f7267 02756b00 0a686f73 746d6173 746572c0
+     45000000 2a00000e 10000000 780064c8 00000000 3c00a031 31858000 01000100
+     01000104 74657374 0369776a 0a72656c 617469.
+ +0.001062
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000600 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003cc00c 00020001 0000003c 0002c041 c0410001 00010001 51800004
+     ac122d06.
+ +0.000937
+ read fd=6 buflen=162
+ read=OK
+     00823132 85800001 00000001 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0c0001c0 0c000600 01000000
+     3c004103 6e73300a 72656c61 74697669 74790867 7265656e 656e6403 6f726702
+     756b000a 686f7374 6d617374 6572c045 0000002a 00000e10 00000078 0064c800
+     0000003c 00823133 85800001 00000001 00000474 65737403 69776a0a 72656c61
+     7469.
+ +0.001660
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000d00 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003c0082 31348580 00010000 00010000 04746573 74036977 6a0a7265
+     6c617469.
+ +0.001133
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000f00 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003c0082 31358580 00010000 00010000 04746573 74036977 6a0a7265
+     6c617469.
+ +0.000963
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00001000 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003c0082 31368580 00010000 00010000 04746573 74036977 6a0a7265
+     6c617469.
+ +0.001248
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00001100 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003c0082 31378580 00010000 00010000 04746573 74036977 6a0a7265
+     6c617469.
+ +0.001740
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000100 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003c0071 31388580 00010001 00000001 04746573 74036977 6a0a7265
+     6c617469.
+ +0.000981
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000200 01c00c00 02000100
+     00003c00 20036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 00c04100 01000100 01518000 04ac122d 06008231 39858000 01000000
+     01000004 74657374 0369776a 0a72656c 61746976 69747908 67726565 6e656e64
+     036f7267.
+ +0.000931
+ read fd=6 buflen=115
+ read=OK
+     02756b00 000c0001 c00c0006 00010000 003c0041 036e7330 0a72656c 61746976
+     69747908 67726565 6e656e64 036f7267 02756b00 0a686f73 746d6173 746572c0
+     45000000 2a00000e 10000000 780064c8 00000000 3c008231 3a858000 01000000
+     01000004 74657374 0369776a 0a72656c 617469.
+ +0.000978
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000f00 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003c00a0 313b8580 00010001 00010001 04746573 74036977 6a0a7265
+     6c617469.
+ +0.000926
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000600 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003cc00c 00020001 0000003c 0002c041 c0410001 00010001 51800004
+     ac122d06.
+ +0.012223
+ read fd=6 buflen=162
+ read=OK
+     0082313c 85800001 00000001 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 110001c0 0c000600 01000000
+     3c004103 6e73300a 72656c61 74697669 74790867 7265656e 656e6403 6f726702
+     756b000a 686f7374 6d617374 6572c045 0000002a 00000e10 00000078 0064c800
+     0000003c 0082313d 85800001 00000001 00000474 65737403 69776a0a 72656c61
+     7469.
+ +0.001327
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000100 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003c0071 313e8580 00010001 00000001 04746573 74036977 6a0a7265
+     6c617469.
+ +0.000945
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000200 01c00c00 02000100
+     00003c00 20036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 00c04100 01000100 01518000 04ac122d 06008231 3f858000 01000000
+     01000004 74657374 0369776a 0a72656c 61746976 69747908 67726565 6e656e64
+     036f7267.
+ +0.000969
+ read fd=6 buflen=115
+ read=OK
+     02756b00 00050001 c00c0006 00010000 003c0041 036e7330 0a72656c 61746976
+     69747908 67726565 6e656e64 036f7267 02756b00 0a686f73 746d6173 746572c0
+     45000000 2a00000e 10000000 780064c8 00000000 3c00a031 40858000 01000100
+     01000104 74657374 0369776a 0a72656c 617469.
+ +0.000930
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000600 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003cc00c 00020001 0000003c 0002c041 c0410001 00010001 51800004
+     ac122d06.
+ +0.000929
+ read fd=6 buflen=162
+ read=OK
+     00823141 85800001 00000001 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 0c0001c0 0c000600 01000000
+     3c004103 6e73300a 72656c61 74697669 74790867 7265656e 656e6403 6f726702
+     756b000a 686f7374 6d617374 6572c045 0000002a 00000e10 00000078 0064c800
+     0000003c 00823142 85800001 00000001 00000474 65737403 69776a0a 72656c61
+     7469.
+ +0.001098
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000d00 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003c0082 31438580 00010000 00010000 04746573 74036977 6a0a7265
+     6c617469.
+ +0.001053
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000f00 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003c0082 31448580 00010000 00010000 04746573 74036977 6a0a7265
+     6c617469.
+ +0.001035
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00001000 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003c0082 31458580 00010000 00010000 04746573 74036977 6a0a7265
+     6c617469.
+ +0.000974
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00001100 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003c0082 31468580 00010000 00010000 04746573 74036977 6a0a7265
+     6c617469.
+ +0.000933
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000100 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003c0071 31478580 00010001 00000001 04746573 74036977 6a0a7265
+     6c617469.
+ +0.001037
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000200 01c00c00 02000100
+     00003c00 20036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 00c04100 01000100 01518000 04ac122d 06008231 48858000 01000000
+     01000004 74657374 0369776a 0a72656c 61746976 69747908 67726565 6e656e64
+     036f7267.
+ +0.000956
+ read fd=6 buflen=115
+ read=OK
+     02756b00 000c0001 c00c0006 00010000 003c0041 036e7330 0a72656c 61746976
+     69747908 67726565 6e656e64 036f7267 02756b00 0a686f73 746d6173 746572c0
+     45000000 2a00000e 10000000 780064c8 00000000 3c008231 49858000 01000000
+     01000004 74657374 0369776a 0a72656c 617469.
+ +0.001151
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000f00 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003c00a0 314a8580 00010001 00010001 04746573 74036977 6a0a7265
+     6c617469.
+ +0.000955
+ read fd=6 buflen=132
+ read=OK
+     76697479 08677265 656e656e 64036f72 6702756b 00000600 01c00c00 06000100
+     00003c00 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 000a686f 73746d61 73746572 c0450000 002a0000 0e100000 00780064
+     c8000000 003cc00c 00020001 0000003c 0002c041 c0410001 00010001 51800004
+     ac122d06.
+ +0.000578
+ read fd=6 buflen=162
+ read=EAGAIN
+ +1.000435
+ write fd=6
+     76697479 08677265 656e656e 64036f72 6702756b 00001100 01.
+ write=25
+ +0.000932
+ select max=7 rfds=[5,6] wfds=[] efds=[6] to=21.691550
+ select=1 rfds=[6] wfds=[] efds=[]
+ +5.-217468
+ read fd=6 buflen=162
+ read=OK
+     0082314b 85800001 00000001 00000474 65737403 69776a0a 72656c61 74697669
+     74790867 7265656e 656e6403 6f726702 756b0000 110001c0 0c000600 01000000
+     3c004103 6e73300a 72656c61 74697669 74790867 7265656e 656e6403 6f726702
+     756b000a 686f7374 6d617374 6572c045 0000002a 00000e10 00000078 0064c800
+     0000003c.
+ +0.217468
+ read fd=6 buflen=162
+ read=EAGAIN
+ +0.017051
+ close fd=5
+ close=OK
+ +0.595595
+ close fd=6
+ close=OK
+ +0.000531
Index: adns/regress/hcommon.c.m4
diff -u adns/regress/hcommon.c.m4:1.14 adns/regress/hcommon.c.m4:1.15
--- adns/regress/hcommon.c.m4:1.14	Sun May  7 23:37:18 2000
+++ adns/regress/hcommon.c.m4	Wed Jun 28 00:01:42 2000
@@ -54,6 +54,7 @@
   { "ENOSPC",                    ENOSPC                       },
   { "EWOULDBLOCK",               EWOULDBLOCK                  },
   { "EHOSTUNREACH",              EHOSTUNREACH                 },
+  { "ECONNRESET",                ECONNRESET                   },
   { "ECONNREFUSED",              ECONNREFUSED                 },
   { "EPIPE",                     EPIPE                        },
   {  0,                          0                            }
Index: adns/regress/hplayback.c.m4
diff -u adns/regress/hplayback.c.m4:1.13 adns/regress/hplayback.c.m4:1.14
--- adns/regress/hplayback.c.m4:1.13	Sun May  7 23:37:18 2000
+++ adns/regress/hplayback.c.m4	Tue Jun 27 23:58:20 2000
@@ -253,6 +253,7 @@
   
 void Q_vb(void) {
   int r;
+  const char *nl;
 
   Tensureinputfile();
   if (!adns__vbuf_ensure(&vb2,vb.used+2)) Tnomem();
@@ -272,6 +273,9 @@
             vb.used,vb.buf, vb.used,vb2.buf+1);
     exit(1);
   }
+  Tensurereportfile();
+  nl= memchr(vb.buf,'\n',vb.used);
+  fprintf(Treportfile," %.*s\n", (int)(nl ? nl - (const char*)vb.buf : vb.used), vb.buf);
 }
 
 m4_define(`hm_syscall', `
@@ -300,7 +304,7 @@
  fgets(vb2.buf,vb2.avail,Tinputfile); Pcheckinput();
 
  Tensurereportfile();
- fprintf(Treportfile,"syscallr %s",vb2.buf);
+ fprintf(Treportfile,"%s",vb2.buf);
  amtread= strlen(vb2.buf);
  if (amtread<=0 || vb2.buf[--amtread]!=hm_squote\nhm_squote)
   Psyntax("badly formed line");
Index: adns/regress/init-anarres.text
diff -u /dev/null adns/regress/init-anarres.text:1.1
--- /dev/null	Wed Aug  9 17:05:17 2000
+++ adns/regress/init-anarres.text	Wed Jun 28 00:01:42 2000
@@ -0,0 +1,2 @@
+nameserver 172.18.45.2
+search davenant.greenend.org.uk
Index: adns/regress/m1test
diff -u adns/regress/m1test:1.8 adns/regress/m1test:1.9
--- adns/regress/m1test:1.8	Sun May  7 23:37:18 2000
+++ adns/regress/m1test	Tue Jun 27 23:07:33 2000
@@ -27,17 +27,25 @@
 
 if [ $# -lt 3 ]
 then
-	echo >&2 'usage: m1test <name> <initfile> [<initflags>] <queryargs>'
+	echo >&2 \
+'usage: m1test <name> <initfile> [<initflags>] [=<hrecord-command-args>]
+       <queryargs>'
 	exit 1
 fi
 
 case="case-$1"; shift
 initfile="$1"; shift
 
+hrecord="./hrecord"
+
 case "$1" in
 -*)	initflags="$1"; shift
 esac
 
+case "$1" in
+=*)	hrecord="`echo \"$1\" | sed -e 's/^=//'`"; shift
+esac
+
 queryargs="$*"
 
 initstring="`cat init-$initfile.text`"
@@ -51,7 +59,7 @@
 echo running hrecord $initflags "/... $queryargs"
 set +e
 ADNS_TEST_OUT_FD=3 3>>"$case.sys" >"$case.out" 2>"$case.err" </dev/null \
- ./hrecord $initflags "/$initstring" $queryargs
+ $hrecord $initflags "/$initstring" $queryargs
 rc=$?
 set -e
 
Index: adns/src/adns.h
diff -u adns/src/adns.h:1.79 adns/src/adns.h:1.80
--- adns/src/adns.h:1.79	Sun May  7 23:37:18 2000
+++ adns/src/adns.h	Tue May  9 22:50:50 2000
@@ -51,14 +51,11 @@
  *  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
  *
- *  $Id: adns.h,v 1.79 2000/05/07 22:37:18 ian Exp $
+ *  $Id: adns.h,v 1.80 2000/05/09 21:50:50 ian Exp $
  */
 
 #ifndef ADNS_H_INCLUDED
 #define ADNS_H_INCLUDED
-#ifdef __cplusplus
-extern "C" { /* I really dislike this - iwj. */
-#endif
 
 #include <stdio.h>
 
@@ -67,6 +64,10 @@
 #include <sys/types.h>
 #include <sys/time.h>
 #include <unistd.h>
+
+#ifdef __cplusplus
+extern "C" { /* I really dislike this - iwj. */
+#endif
 
 /* All struct in_addr anywhere in adns are in NETWORK byte order. */
 
Index: adns/src/event.c
diff -u adns/src/event.c:1.52 adns/src/event.c:1.54
--- adns/src/event.c:1.52	Sun May  7 23:37:18 2000
+++ adns/src/event.c	Wed Jun 28 00:01:42 2000
@@ -54,11 +54,18 @@
 
 void adns__tcp_broken(adns_state ads, const char *what, const char *why) {
   int serv;
+  adns_query qu;
   
   assert(ads->tcpstate == server_connecting || ads->tcpstate == server_ok);
   serv= ads->tcpserver;
   if (what) adns__warn(ads,serv,0,"TCP connection failed: %s: %s",what,why);
 
+  if (ads->tcpstate == server_connecting) {
+    /* Counts as a retry for all the queries waiting for TCP. */
+    for (qu= ads->tcpw.head; qu; qu= qu->next)
+      qu->retries++;
+  }
+
   tcp_close(ads);
   ads->tcpstate= server_broken;
   ads->tcpserver= (serv+1)%ads->nservers;
@@ -328,6 +335,7 @@
 
   switch (ads->tcpstate) {
   case server_disconnected:
+  case server_broken:
   case server_connecting:
     break;
   case server_ok:
@@ -425,6 +433,7 @@
 
   switch (ads->tcpstate) {
   case server_disconnected:
+  case server_broken:
     break;
   case server_connecting:
     if (fd != ads->tcpsocket) break;
@@ -447,8 +456,8 @@
       r= 0; goto xit;
     } /* not reached */
   case server_ok:
-    if (!(ads->tcpsend.used && fd == ads->tcpsocket)) break;
-    for (;;) {
+    if (fd != ads->tcpsocket) break;
+    while (ads->tcpsend.used) {
       adns__sigpipe_protect(ads);
       r= write(ads->tcpsocket,ads->tcpsend.buf,ads->tcpsend.used);
       adns__sigpipe_unprotect(ads);
@@ -462,7 +471,9 @@
 	ads->tcpsend.used -= r;
 	memmove(ads->tcpsend.buf,ads->tcpsend.buf+r,ads->tcpsend.used);
       }
-    } /* not reached */
+    }
+    r= 0;
+    goto xit;
   default:
     abort();
   }
@@ -476,6 +487,7 @@
   adns__consistency(ads,0,cc_entex);
   switch (ads->tcpstate) {
   case server_disconnected:
+  case server_broken:
     break;
   case server_connecting:
   case server_ok:
@@ -596,6 +608,7 @@
     adns__tcp_broken(ads,0,0);
     break;
   case server_disconnected:
+  case server_broken:
     break;
   default:
     abort();
@@ -619,7 +632,7 @@
    * likely just to want to do a read on one or two fds anyway.
    */
   npollfds= adns__pollfds(ads,pollfds);
-  for (i=0; i<npollfds; i++) pollfds[i].revents= pollfds[i].events;
+  for (i=0; i<npollfds; i++) pollfds[i].revents= pollfds[i].events & ~POLLPRI;
   adns__fdevents(ads,
 		 pollfds,npollfds,
 		 0,0,0,0,
Index: adns/src/query.c
diff -u adns/src/query.c:1.59 adns/src/query.c:1.61
--- adns/src/query.c:1.59	Sun May  7 23:37:18 2000
+++ adns/src/query.c	Wed Jun 28 00:16:48 2000
@@ -374,6 +374,7 @@
   LIST_UNLINK(from->allocations,an);
   LIST_LINK_TAIL(to->allocations,an);
 
+  sz= MEM_ROUND(sz);
   from->interim_allocd -= sz;
   to->interim_allocd += sz;
 
@@ -422,6 +423,7 @@
   adns__vbuf_free(&qu->vb);
   adns__vbuf_free(&qu->search_vb);
   free(qu->query_dgram);
+  qu->query_dgram= 0;
 }
 
 void adns_cancel(adns_query qu) {
Index: adns/src/reply.c
diff -u adns/src/reply.c:1.39 adns/src/reply.c:1.40
--- adns/src/reply.c:1.39	Sun May  7 23:37:18 2000
+++ adns/src/reply.c	Wed Jun 28 01:02:40 2000
@@ -126,7 +126,7 @@
     if (qu) adns__query_fail(qu,adns_s_rcodenotimplemented);
     return;
   case rcode_refused:
-    adns__warn(ads,serv,qu,"server refused our query");
+    adns__debug(ads,serv,qu,"server refused our query");
     if (qu) adns__query_fail(qu,adns_s_rcoderefused);
     return;
   default:
@@ -287,7 +287,7 @@
       if (!flg_rd)
 	adns__diag(ads,serv,qu,"server thinks we didn't ask for recursive lookup");
       else
-	adns__diag(ads,serv,qu,"server claims to do recursion, but gave us a referral");
+	adns__debug(ads,serv,qu,"server claims to do recursion, but gave us a referral");
       adns__query_fail(qu,adns_s_invalidresponse);
     }
     return;
Index: adns/src/transmit.c
diff -u adns/src/transmit.c:1.20 adns/src/transmit.c:1.21
--- adns/src/transmit.c:1.20	Sun May  7 23:37:18 2000
+++ adns/src/transmit.c	Sun May 21 18:21:58 2000
@@ -248,7 +248,7 @@
   r= sendto(ads->udpsocket,qu->query_dgram,qu->query_dglen,0,
 	    (const struct sockaddr*)&servaddr,sizeof(servaddr));
   if (r<0 && errno == EMSGSIZE) { qu->retries= 0; query_usetcp(qu,now); return; }
-  if (r<0) adns__warn(ads,serv,0,"sendto failed: %s",strerror(errno));
+  if (r<0 && errno != EAGAIN) adns__warn(ads,serv,0,"sendto failed: %s",strerror(errno));
   
   qu->timeout= now;
   timevaladd(&qu->timeout,UDPRETRYMS);
