* 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
* '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.
* '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'.
*
* 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>
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);
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)
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);
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)
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);
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)