From 4b7d316065e104fcc3e9a985514442951b95a8de Mon Sep 17 00:00:00 2001 From: Michael Sawyer Date: Fri, 14 Jul 2000 21:33:03 +0000 Subject: [PATCH] A few bug fixes. --- bin/dig/dig.c | 37 ++++++++++++++----------------------- bin/dig/dighost.c | 12 +++++++----- 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/bin/dig/dig.c b/bin/dig/dig.c index 52036f92a3..1557272a42 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: dig.c,v 1.67 2000/07/14 17:57:23 mws Exp $ */ +/* $Id: dig.c,v 1.68 2000/07/14 21:33:02 mws Exp $ */ #include #include @@ -862,28 +862,19 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) { rv++; rc--; } else { - /* - * If we decide to allow query type and class - * to be specified (without -t and -c options) - * before a host is given, all that needs to - * happen is the have_host test here get removed. - * Nothing should break by doing this. - */ - if (have_host) { - if (strncmp(rv[0], "ixfr=", 5) == 0) { - strcpy(lookup->rttext, "ixfr"); - lookup->ixfr_serial = - atoi(&rv[0][5]); - continue; - } - if (istype(rv[0])) { - strncpy(lookup->rttext, rv[0], MXRD); - continue; - } else if (isclass(rv[0])) { - strncpy(lookup->rctext, rv[0], - MXRD); - continue; - } + if (strncmp(rv[0], "ixfr=", 5) == 0) { + strcpy(lookup->rttext, "ixfr"); + lookup->ixfr_serial = + atoi(&rv[0][5]); + continue; + } + if (istype(rv[0])) { + strncpy(lookup->rttext, rv[0], MXRD); + continue; + } else if (isclass(rv[0])) { + strncpy(lookup->rctext, rv[0], + MXRD); + continue; } lookup=clone_lookup(default_lookup, ISC_TRUE); strncpy(lookup->textname, rv[0], MXNAME-1); diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index dbfdf0eadc..ac1ae6de3b 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: dighost.c,v 1.88 2000/07/14 20:14:36 mws Exp $ */ +/* $Id: dighost.c,v 1.89 2000/07/14 21:33:03 mws Exp $ */ /* * Notice to programmers: Do not use this code as an example of how to @@ -387,7 +387,7 @@ requeue_lookup(dig_lookup_t *lookold, isc_boolean_t servers) { debug("before insertion, init@%p " "-> %p, new@%p -> %p", lookold, lookold->link.next, looknew, looknew->link.next); - ISC_LIST_INSERTAFTER(lookup_list, lookold, looknew, link); + ISC_LIST_PREPEND(lookup_list, looknew, link); debug("after insertion, init -> " "%p, new = %p, new -> %p", lookold, looknew, looknew->link.next); @@ -1504,6 +1504,7 @@ tcp_length_done(isc_task_t *task, isc_event_t *event) { l = query->lookup; clear_query(query); check_next_lookup(l); + UNLOCK_LOOKUP; return; } if (sevent->result != ISC_R_SUCCESS) { @@ -1523,6 +1524,7 @@ tcp_length_done(isc_task_t *task, isc_event_t *event) { INSIST(sockcount >= 0); isc_event_free(&event); check_next_lookup(query->lookup); + UNLOCK_LOOKUP; return; } b = ISC_LIST_HEAD(sevent->bufferlist); @@ -1971,7 +1973,8 @@ recv_done(isc_task_t *task, isc_event_t *event) { * outages won't cause the XFR to abort */ if ((timeout != INT_MAX) && - (l->timer != NULL)) { + (l->timer != NULL) && + l->doing_xfr ) { if (timeout == 0) { if (l->tcp_mode) local_timeout = TCP_TIMEOUT; @@ -2309,7 +2312,7 @@ xfree_lists(void) { dig_server_t *s; dig_searchlist_t *o; - debug("free_lists()"); + debug("xfree_lists()"); REQUIRE(sockcount == 0); REQUIRE(recvcount == 0); @@ -2326,7 +2329,6 @@ xfree_lists(void) { debug("freeing global server %p", s); ptr = s; s = ISC_LIST_NEXT(s, link); - debug("ptr is now %p", ptr); isc_mem_free(mctx, ptr); } o = ISC_LIST_HEAD(search_list);