X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fquery.c;h=53eecd9b902e47ff11c30700da4a8dcbfbfc4032;hb=94be415aea9fb1e252a9a51af34dce5bdb7d115a;hp=a676376587ca7053ef758b3511c305d1f0054a38;hpb=bfc2c80e5bed3c17f3cf7451939458b0357bfd38;p=adns.git diff --git a/src/query.c b/src/query.c index a676376..53eecd9 100644 --- a/src/query.c +++ b/src/query.c @@ -5,7 +5,12 @@ * - query submission and cancellation (user-visible and internal) */ /* - * This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson + * This file is + * Copyright (C) 1997-1999 Ian Jackson + * + * It is part of adns, which is + * Copyright (C) 1997-1999 Ian Jackson + * Copyright (C) 1999 Tony Finch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -346,7 +351,6 @@ static void cancel_children(adns_query qu) { ncqu= cqu->siblings.next; adns_cancel(cqu); } - LIST_INIT(qu->children); } void adns__reset_preserved(adns_query qu) { @@ -371,6 +375,7 @@ void adns_cancel(adns_query qu) { ads= qu->ads; adns__consistency(ads,qu,cc_entex); + if (qu->parent) LIST_UNLINK_PART(qu->parent->children,qu,siblings.); switch (qu->state) { case query_tosend: case query_tcpwait: case query_tcpsent: LIST_UNLINK(ads->timew,qu); @@ -474,8 +479,8 @@ void adns__query_done(adns_query qu) { } else { makefinal_query(qu); LIST_LINK_TAIL(qu->ads->output,qu); + qu->state= query_done; } - qu->state= query_done; } void adns__query_fail(adns_query qu, adns_status stat) {