summaryrefslogtreecommitdiff
path: root/bin/named
diff options
context:
space:
mode:
authorInternet Software Consortium, Inc <@isc.org>2007-09-07 14:14:48 -0600
committerLaMont Jones <lamont@debian.org>2007-09-07 14:14:48 -0600
commit96ea6c01ea7a3018373931f24aa8977d0b02b1cd (patch)
tree838b3a828ea533dac3884b4312b88089c9432b6b /bin/named
parent5aa4b07b2a6d481b1af76e3d0693dacdd5825017 (diff)
downloadbind9-96ea6c01ea7a3018373931f24aa8977d0b02b1cd.tar.gz
9.2.4rc7
Diffstat (limited to 'bin/named')
-rw-r--r--bin/named/Makefile.in4
-rw-r--r--bin/named/client.c13
-rw-r--r--bin/named/include/named/client.h3
-rw-r--r--bin/named/interfacemgr.c8
-rw-r--r--bin/named/update.c49
5 files changed, 50 insertions, 27 deletions
diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in
index cebe49f0..bb19677c 100644
--- a/bin/named/Makefile.in
+++ b/bin/named/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.74.2.2 2004/03/09 06:09:17 marka Exp $
+# $Id: Makefile.in,v 1.74.2.3 2004/07/20 07:00:10 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
@@ -100,7 +100,7 @@ config.@O@: config.c
-c ${srcdir}/config.c
named: ${OBJS} ${UOBJS} ${DEPLIBS}
- ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} -o $@ ${OBJS} ${UOBJS} ${LIBS}
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${OBJS} ${UOBJS} ${LIBS}
lwresd: named
rm -f lwresd
diff --git a/bin/named/client.c b/bin/named/client.c
index f40c110a..4074fbd0 100644
--- a/bin/named/client.c
+++ b/bin/named/client.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: client.c,v 1.176.2.15 2004/04/28 14:17:03 marka Exp $ */
+/* $Id: client.c,v 1.176.2.16 2004/07/23 02:56:59 marka Exp $ */
#include <config.h>
@@ -218,13 +218,20 @@ exit_check(ns_client_t *client) {
* - The client does not detach from the view until references is zero
* - references does not go to zero until the resolver has shut down
*
+ * Keep the view attached until any outstanding updates complete.
*/
- if (client->newstate == NS_CLIENTSTATE_FREED && client->view != NULL)
+ if (client->nupdates == 0 &&
+ client->newstate == NS_CLIENTSTATE_FREED && client->view != NULL)
dns_view_detach(&client->view);
if (client->state == NS_CLIENTSTATE_WORKING) {
INSIST(client->newstate <= NS_CLIENTSTATE_READING);
/*
+ * Let the update processing complete.
+ */
+ if (client->nupdates > 0)
+ return (ISC_TRUE);
+ /*
* We are trying to abort request processing.
*/
if (client->nsends > 0) {
@@ -519,6 +526,7 @@ ns_client_endrequest(ns_client_t *client) {
INSIST(client->nreads == 0);
INSIST(client->nsends == 0);
INSIST(client->nrecvs == 0);
+ INSIST(client->nupdates == 0);
INSIST(client->state == NS_CLIENTSTATE_WORKING);
CTRACE("endrequest");
@@ -1569,6 +1577,7 @@ client_create(ns_clientmgr_t *manager, ns_client_t **clientp)
client->nreads = 0;
client->nsends = 0;
client->nrecvs = 0;
+ client->nupdates = 0;
client->nctls = 0;
client->references = 0;
client->attributes = 0;
diff --git a/bin/named/include/named/client.h b/bin/named/include/named/client.h
index 99008211..3589c5b2 100644
--- a/bin/named/include/named/client.h
+++ b/bin/named/include/named/client.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: client.h,v 1.60.2.3 2004/03/09 06:09:21 marka Exp $ */
+/* $Id: client.h,v 1.60.2.4 2004/07/23 02:57:01 marka Exp $ */
#ifndef NAMED_CLIENT_H
#define NAMED_CLIENT_H 1
@@ -91,6 +91,7 @@ struct ns_client {
int nreads;
int nsends;
int nrecvs;
+ int nupdates;
int nctls;
int references;
unsigned int attributes;
diff --git a/bin/named/interfacemgr.c b/bin/named/interfacemgr.c
index 24d7aa4f..96b7c749 100644
--- a/bin/named/interfacemgr.c
+++ b/bin/named/interfacemgr.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: interfacemgr.c,v 1.59.2.6 2004/03/09 06:09:18 marka Exp $ */
+/* $Id: interfacemgr.c,v 1.59.2.7 2004/08/10 04:58:00 jinmei Exp $ */
#include <config.h>
@@ -348,9 +348,9 @@ ns_interface_setup(ns_interfacemgr_t *mgr, isc_sockaddr_t *addr,
if (result != ISC_R_SUCCESS) {
/*
* XXXRTH We don't currently have a way to easily stop dispatch
- * service, so we return currently return ISC_R_SUCCESS (the
- * UDP stuff will work even if TCP creation failed). This will
- * be fixed later.
+ * service, so we currently return ISC_R_SUCCESS (the UDP stuff
+ * will work even if TCP creation failed). This will be fixed
+ * later.
*/
result = ISC_R_SUCCESS;
}
diff --git a/bin/named/update.c b/bin/named/update.c
index 22829183..439e52f9 100644
--- a/bin/named/update.c
+++ b/bin/named/update.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: update.c,v 1.88.2.11 2004/06/20 23:44:35 marka Exp $ */
+/* $Id: update.c,v 1.88.2.13 2004/07/23 02:57:00 marka Exp $ */
#include <config.h>
@@ -1893,6 +1893,8 @@ send_update_event(ns_client_t *client, dns_zone_t *zone) {
evclient = NULL;
ns_client_attach(client, &evclient);
+ INSIST(client->nupdates == 0);
+ client->nupdates++;
event->ev_arg = evclient;
dns_zone_gettask(zone, &zonetask);
@@ -2456,26 +2458,29 @@ update_action(isc_task_t *task, isc_event_t *event) {
dns_journal_destroy(&journal);
}
- }
- /*
- * XXXRTH Just a note that this committing code will have to change
- * to handle databases that need two-phase commit, but this
- * isn't a priority.
- */
- update_log(client, zone, LOGLEVEL_DEBUG,
- "committing update transaction");
- dns_db_closeversion(db, &ver, ISC_TRUE);
+ /*
+ * XXXRTH Just a note that this committing code will have
+ * to change to handle databases that need two-phase
+ * commit, but this isn't a priority.
+ */
+ update_log(client, zone, LOGLEVEL_DEBUG,
+ "committing update transaction");
+ dns_db_closeversion(db, &ver, ISC_TRUE);
- /*
- * Mark the zone as dirty so that it will be written to disk.
- */
- dns_zone_markdirty(zone);
+ /*
+ * Mark the zone as dirty so that it will be written to disk.
+ */
+ dns_zone_markdirty(zone);
- /*
- * Notify slaves of the change we just made.
- */
- dns_zone_notify(zone);
+ /*
+ * Notify slaves of the change we just made.
+ */
+ dns_zone_notify(zone);
+ } else {
+ update_log(client, zone, LOGLEVEL_DEBUG, "redundant request");
+ dns_db_closeversion(db, &ver, ISC_TRUE);
+ }
result = ISC_R_SUCCESS;
goto common;
@@ -2523,6 +2528,8 @@ updatedone_action(isc_task_t *task, isc_event_t *event) {
INSIST(event->ev_type == DNS_EVENT_UPDATEDONE);
INSIST(task == client->task);
+ INSIST(client->nupdates > 0);
+ client->nupdates--;
respond(client, uev->result);
ns_client_detach(&client);
isc_event_free(&event);
@@ -2538,6 +2545,8 @@ forward_fail(isc_task_t *task, isc_event_t *event) {
UNUSED(task);
+ INSIST(client->nupdates > 0);
+ client->nupdates--;
respond(client, DNS_R_SERVFAIL);
ns_client_detach(&client);
isc_event_free(&event);
@@ -2568,6 +2577,8 @@ forward_done(isc_task_t *task, isc_event_t *event) {
UNUSED(task);
+ INSIST(client->nupdates > 0);
+ client->nupdates--;
ns_client_sendraw(client, uev->answer);
dns_message_destroy(&uev->answer);
isc_event_free(&event);
@@ -2609,6 +2620,8 @@ send_forward_event(ns_client_t *client, dns_zone_t *zone) {
evclient = NULL;
ns_client_attach(client, &evclient);
+ INSIST(client->nupdates == 0);
+ client->nupdates++;
event->ev_arg = evclient;
dns_zone_gettask(zone, &zonetask);