mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-12 05:32:42 -04:00
Fixed an error in change 3023, ensuring that journal file isn't
removed after IXFR. No CHANGES note.
This commit is contained in:
parent
9e72291848
commit
63b1c80af8
1 changed files with 19 additions and 11 deletions
|
|
@ -15,7 +15,7 @@
|
|||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: xfrin.c,v 1.168 2011/02/18 23:47:25 tbox Exp $ */
|
||||
/* $Id: xfrin.c,v 1.169 2011/02/19 01:24:46 each Exp $ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
|
|
@ -83,8 +83,9 @@ typedef enum {
|
|||
XFRST_IXFR_DEL,
|
||||
XFRST_IXFR_ADDSOA,
|
||||
XFRST_IXFR_ADD,
|
||||
XFRST_IXFR_END,
|
||||
XFRST_AXFR,
|
||||
XFRST_END
|
||||
XFRST_AXFR_END
|
||||
} xfrin_state_t;
|
||||
|
||||
/*%
|
||||
|
|
@ -552,7 +553,7 @@ xfr_rr(dns_xfrin_ctx_t *xfr, dns_name_t *name, isc_uint32_t ttl,
|
|||
isc_uint32_t soa_serial = dns_soa_getserial(rdata);
|
||||
if (soa_serial == xfr->end_serial) {
|
||||
CHECK(ixfr_commit(xfr));
|
||||
xfr->state = XFRST_END;
|
||||
xfr->state = XFRST_IXFR_END;
|
||||
break;
|
||||
} else if (soa_serial != xfr->ixfr.current_serial) {
|
||||
xfrin_log(xfr, ISC_LOG_ERROR,
|
||||
|
|
@ -583,11 +584,12 @@ xfr_rr(dns_xfrin_ctx_t *xfr, dns_name_t *name, isc_uint32_t ttl,
|
|||
CHECK(axfr_putdata(xfr, DNS_DIFFOP_ADD, name, ttl, rdata));
|
||||
if (rdata->type == dns_rdatatype_soa) {
|
||||
CHECK(axfr_commit(xfr));
|
||||
xfr->state = XFRST_END;
|
||||
xfr->state = XFRST_AXFR_END;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case XFRST_END:
|
||||
case XFRST_AXFR_END:
|
||||
case XFRST_IXFR_END:
|
||||
FAIL(DNS_R_EXTRADATA);
|
||||
default:
|
||||
INSIST(0);
|
||||
|
|
@ -1329,8 +1331,9 @@ xfrin_recv_done(isc_task_t *task, isc_event_t *ev) {
|
|||
|
||||
} else if (dns_message_gettsigkey(msg) != NULL) {
|
||||
xfr->sincetsig++;
|
||||
if (xfr->sincetsig > 100 ||
|
||||
xfr->nmsg == 0 || xfr->state == XFRST_END)
|
||||
if (xfr->sincetsig > 100 || xfr->nmsg == 0 ||
|
||||
xfr->state == XFRST_AXFR_END ||
|
||||
xfr->state == XFRST_IXFR_END)
|
||||
{
|
||||
result = DNS_R_EXPECTEDTSIG;
|
||||
goto failure;
|
||||
|
|
@ -1356,18 +1359,22 @@ xfrin_recv_done(isc_task_t *task, isc_event_t *ev) {
|
|||
|
||||
dns_message_destroy(&msg);
|
||||
|
||||
if (xfr->state == XFRST_GOTSOA) {
|
||||
switch (xfr->state) {
|
||||
case XFRST_GOTSOA:
|
||||
xfr->reqtype = dns_rdatatype_axfr;
|
||||
xfr->state = XFRST_INITIALSOA;
|
||||
CHECK(xfrin_send_request(xfr));
|
||||
} else if (xfr->state == XFRST_END) {
|
||||
break;
|
||||
case XFRST_AXFR_END:
|
||||
CHECK(axfr_finalize(xfr));
|
||||
|
||||
/* FALLTHROUGH */
|
||||
case XFRST_IXFR_END:
|
||||
/*
|
||||
* Close the journal.
|
||||
*/
|
||||
if (xfr->ixfr.journal != NULL)
|
||||
dns_journal_destroy(&xfr->ixfr.journal);
|
||||
|
||||
/*
|
||||
* Inform the caller we succeeded.
|
||||
*/
|
||||
|
|
@ -1381,7 +1388,8 @@ xfrin_recv_done(isc_task_t *task, isc_event_t *ev) {
|
|||
*/
|
||||
xfr->shuttingdown = ISC_TRUE;
|
||||
maybe_free(xfr);
|
||||
} else {
|
||||
break;
|
||||
default:
|
||||
/*
|
||||
* Read the next message.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue