Commit 1599bd69 authored by Mark Andrews's avatar Mark Andrews
Browse files

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]
parent c8fc692f
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.
......
......@@ -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'.
*
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment