]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
620. [bug] dns_master_load*inc() now require 'task' and 'load'
authorMark Andrews <marka@isc.org>
Sun, 17 Dec 2000 23:43:12 +0000 (23:43 +0000)
committerMark Andrews <marka@isc.org>
Sun, 17 Dec 2000 23:43:12 +0000 (23:43 +0000)
                        to be non-null.  Also 'done' will not be called if
                        dns_master_load*inc() fails immediately. [RT #565]

CHANGES
lib/dns/include/dns/master.h
lib/dns/master.c

diff --git a/CHANGES b/CHANGES
index e134e056e9757142db4ca06eebb419ddde419acc..988f27e7d14088194a7d338692f7ff9a81dffbb3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+ 620.  [bug]           dns_master_load*inc() now require 'task' and 'load'
+                       to be non-null.  Also 'done' will not be called if
+                       dns_master_load*inc() fails immediately. [RT #565]
 
  618.  [bug]           Queries to a signed zone could sometimes cause
                        an assertion failure.
index 269bbf4bd4feba9e53cc47a5067e0d85769198b5..73d2a7830a20587a597ee95a80557ce6f96bcd50 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: master.h,v 1.25 2000/10/17 07:22:36 marka Exp $ */
+/* $Id: master.h,v 1.26 2000/12/17 23:43:12 marka Exp $ */
 
 #ifndef DNS_MASTER_H
 #define DNS_MASTER_H 1
@@ -119,7 +119,8 @@ dns_master_loadfilequota(const char *master_file, dns_name_t *top,
  * 'callbacks->warn' to generate any error messages required.
  *
  * 'done' is called with 'done_arg' and a result code when the loading
- * is completed or has failed if 'done' is non NULL.
+ * is completed or has failed.  If the initial setup fails 'done' is
+ * not called.
  *
  * Requires:
  *     'master_file' points to a valid string.
@@ -128,9 +129,8 @@ dns_master_loadfilequota(const char *master_file, dns_name_t *top,
  *     'callbacks->commit' points to a valid function.
  *     'callbacks->error' points to a valid function.
  *     'callbacks->warn' points to a valid function.
- *     'callbacks->done' points to a valid function or NULL.
  *     'mctx' points to a valid memory context.
- *     'task' and 'done' to be NULL or 'task' and 'done' to be valid.
+ *     'task' and 'done' to be valid.
  *     'lmgr' to be valid.
  *     'ctxp != NULL && ctxp == NULL'.
  *
index 6b55b22cf29dbff730663354b5a06a8c1344c8ed..90b872e0652c3df2fda256aee754c98f7bc27f25 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: master.c,v 1.86 2000/12/07 20:15:49 marka Exp $ */
+/* $Id: master.c,v 1.87 2000/12/17 23:43:10 marka Exp $ */
 
 #include <config.h>
 
@@ -1610,6 +1610,9 @@ dns_master_loadfileinc(const char *master_file, dns_name_t *top,
        dns_loadctx_t *ctx = NULL;
        isc_result_t tresult;
        isc_result_t result;
+       
+       REQUIRE(task != NULL);
+       REQUIRE(done != NULL);
 
        result = loadctx_create(mctx, age_ttl, top, zclass, origin,
                                callbacks, task, done, done_arg, &ctx);
@@ -1620,15 +1623,9 @@ dns_master_loadfileinc(const char *master_file, dns_name_t *top,
        if (result != ISC_R_SUCCESS)
                goto cleanup;
 
-       result = load(&ctx);
-       if (result == DNS_R_CONTINUE) {
-               tresult = task_send(ctx);
-               if (tresult == ISC_R_SUCCESS)
-                       return (result);
-               result = tresult;
-       }
-       if (ctx->done != NULL)
-               (ctx->done)(ctx->done_arg, result);
+       result = task_send(ctx);
+       if (result == ISC_R_SUCCESS)
+               return (DNS_R_CONTINUE);
 
  cleanup:
        if (ctx != NULL)
@@ -1676,6 +1673,8 @@ dns_master_loadstreaminc(FILE *stream, dns_name_t *top, dns_name_t *origin,
        dns_loadctx_t *ctx = NULL;
 
        REQUIRE(stream != NULL);
+       REQUIRE(task != NULL);
+       REQUIRE(done != NULL);
 
        result = loadctx_create(mctx, age_ttl, top, zclass, origin,
                                callbacks, task, done, done_arg, &ctx);
@@ -1686,15 +1685,9 @@ dns_master_loadstreaminc(FILE *stream, dns_name_t *top, dns_name_t *origin,
        if (result != ISC_R_SUCCESS)
                goto cleanup;
 
-       result = load(&ctx);
-       if (result == DNS_R_CONTINUE) {
-               tresult = task_send(ctx);
-               if (tresult == ISC_R_SUCCESS)
-                       return (result);
-               result = tresult;
-       }
-       if (ctx->done != NULL)
-               (ctx->done)(ctx->done_arg, result);
+       result = task_send(ctx);
+       if (result == ISC_R_SUCCESS)
+               return (DNS_R_CONTINUE);
 
  cleanup:
        if (ctx != NULL)
@@ -1744,6 +1737,8 @@ dns_master_loadbufferinc(isc_buffer_t *buffer, dns_name_t *top,
        dns_loadctx_t *ctx = NULL;
 
        REQUIRE(buffer != NULL);
+       REQUIRE(task != NULL);
+       REQUIRE(done != NULL);
 
        result = loadctx_create(mctx, age_ttl, top, zclass, origin,
                                callbacks, task, done, done_arg, &ctx);
@@ -1754,15 +1749,9 @@ dns_master_loadbufferinc(isc_buffer_t *buffer, dns_name_t *top,
        if (result != ISC_R_SUCCESS)
                goto cleanup;
 
-       result = load(&ctx);
-       if (result == DNS_R_CONTINUE) {
-               tresult = task_send(ctx);
-               if (tresult == ISC_R_SUCCESS)
-                       return (result);
-               result = tresult;
-       }
-       if (ctx->done != NULL)
-               (ctx->done)(ctx->done_arg, result);
+       result = task_send(ctx);
+       if (result == ISC_R_SUCCESS)
+               return (DNS_R_CONTINUE);
 
  cleanup:
        if (ctx != NULL)