* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: resolver.c,v 1.284.18.53 2006/12/07 06:50:34 marka Exp $ */
+/* $Id: resolver.c,v 1.284.18.54 2007/01/08 00:45:11 marka Exp $ */
/*! \file */
dns_name_t nsname;
dns_fetch_t * nsfetch;
dns_rdataset_t nsrrset;
+
+ /*%
+ * Number of queries that reference this context.
+ */
+ unsigned int nqueries;
};
#define FCTX_MAGIC ISC_MAGIC('F', '!', '!', '!')
dns_rdataset_t *ardataset,
isc_result_t *eresultp);
static void validated(isc_task_t *task, isc_event_t *event);
+static void maybe_destroy(fetchctx_t *fctx);
static isc_result_t
valcreate(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo, dns_name_t *name,
INSIST(query->tcpsocket == NULL);
+ query->fctx->nqueries--;
+ if (SHUTTINGDOWN(query->fctx))
+ maybe_destroy(query->fctx); /* Locks bucket. */
query->magic = 0;
isc_mem_put(query->mctx, query, sizeof(*query));
*queryp = NULL;
}
ISC_LIST_APPEND(fctx->queries, query, link);
+ query->fctx->nqueries++;
return (ISC_R_SUCCESS);
want_done = ISC_TRUE;
}
} else if (SHUTTINGDOWN(fctx) && fctx->pending == 0 &&
- ISC_LIST_EMPTY(fctx->validators)) {
+ fctx->nqueries == 0 && ISC_LIST_EMPTY(fctx->validators)) {
bucketnum = fctx->bucketnum;
LOCK(&res->buckets[bucketnum].lock);
/*
REQUIRE(ISC_LIST_EMPTY(fctx->finds));
REQUIRE(ISC_LIST_EMPTY(fctx->altfinds));
REQUIRE(fctx->pending == 0);
- REQUIRE(ISC_LIST_EMPTY(fctx->validators));
REQUIRE(fctx->references == 0);
+ REQUIRE(ISC_LIST_EMPTY(fctx->validators));
FCTXTRACE("destroy");
}
if (fctx->references == 0 && fctx->pending == 0 &&
- ISC_LIST_EMPTY(fctx->validators))
+ fctx->nqueries == 0 && ISC_LIST_EMPTY(fctx->validators))
bucket_empty = fctx_destroy(fctx);
UNLOCK(&res->buckets[bucketnum].lock);
* pending ADB finds and no pending validations.
*/
INSIST(fctx->pending == 0);
+ INSIST(fctx->nqueries == 0);
INSIST(ISC_LIST_EMPTY(fctx->validators));
if (fctx->references == 0) {
/*
fctx->timeouts = 0;
fctx->attributes = 0;
fctx->spilled = ISC_FALSE;
+ fctx->nqueries = 0;
dns_name_init(&fctx->nsname, NULL);
fctx->nsfetch = NULL;
REQUIRE(SHUTTINGDOWN(fctx));
- if (fctx->pending != 0 || !ISC_LIST_EMPTY(fctx->validators))
+ if (fctx->pending != 0 || fctx->nqueries != 0 ||
+ !ISC_LIST_EMPTY(fctx->validators))
return;
bucketnum = fctx->bucketnum;
/*
* No one cares about the result of this fetch anymore.
*/
- if (fctx->pending == 0 && ISC_LIST_EMPTY(fctx->validators) &&
+ if (fctx->pending == 0 && fctx->nqueries == 0 &&
+ ISC_LIST_EMPTY(fctx->validators) &&
SHUTTINGDOWN(fctx)) {
/*
* This fctx is already shutdown; we were just
#!/usr/local/bin/perl -w
#
-# Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 1998-2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: update_copyrights,v 1.32.18.9 2005/09/06 01:59:47 marka Exp $
+# $Id: update_copyrights,v 1.32.18.10 2007/01/08 00:45:12 marka Exp $
require 5.002;
# Map copyright owners to the files containing copyright messages.
# The first line of the copyright message is not in the file;
# it is constructed by this script.
+#
+# Usage:
+#
+# perl util/update_copyrights <util/copyrights
my %owner2filename = (
"" => "util/COPYRIGHT",
print "$file: missing\n";
next;
}
+ # print "Doing: $file";
if ($years_list =~ /PARENT:/) {
getyears($years_list);
$start_comment = "/*\n";
$prefix = " * ";
$end_comment = " */\n";
- } elsif ($type =~ /^(SH|PERL|TCL|MAKE|CONF-SH)$/) {
+ } elsif ($type =~ /^(SH|PERL|TCL|MAKE|CONF-SH|RNC)$/) {
$shell_comment = 1;
$prefix = "# ";
} elsif ($type eq "ZONE" || $type eq "MC") {
}
}
} elsif ($sgml_comment) {
- if (/^<!DOCTYPE/) {
- $before_copyright = $_;
- $_ = <SOURCE>;
- ;
+ $before_copyright = "";
+ while (/^<!DOCTYPE/ || /^<\?xml-stylesheet/ || /^<\?xml /) {
+ # print "SGML: $_";
+ $before_copyright = "$before_copyright$_";
+ if (/>$/ ) {
+ $_ = <SOURCE>;
+ close(SOURCE) if (eof(SOURCE));
+ next;
+ }
+ $_ = <SOURCE>;
while (!eof(SOURCE) && ! /^<!/ ) {
$before_copyright = "$before_copyright$_";
$_ = <SOURCE>;
$_ = <SOURCE>;
$/ = "\n";
+ if ($type eq 'SGML' && m:<articleinfo>.*?</articleinfo>:s) {
+ # print "docinfo: $file\n";
+ my $r = copyrights(@years);
+ s:<articleinfo>.*?</articleinfo>:<articleinfo>\n$r </articleinfo>:s;
+ }
if ($type eq 'SGML' && m:<docinfo>.*?</docinfo>:s) {
# print "docinfo: $file\n";
my $r = copyrights(@years);