]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fixed an error in change 3023, ensuring that journal file isn't
authorEvan Hunt <each@isc.org>
Sat, 19 Feb 2011 01:21:27 +0000 (01:21 +0000)
committerEvan Hunt <each@isc.org>
Sat, 19 Feb 2011 01:21:27 +0000 (01:21 +0000)
removed after IXFR.  No CHANGES note.

bin/tests/system/xfer/tests.sh
lib/dns/xfrin.c

index 3356f81ca0f714f5b2ff0480b4267c23af19ccc3..b0fde9d3775757f0c31d9020bd39db419533125a 100644 (file)
@@ -15,7 +15,7 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: tests.sh,v 1.31 2007/06/19 23:47:07 tbox Exp $
+# $Id: tests.sh,v 1.31.814.1 2011/02/19 01:21:27 each Exp $
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
index e7d4a9872f7e79cb6e1c23d9ee9cc93ae7aa4b6d..1e98d7cf4c0a54bca5715c5b10ccfe19113a1f7d 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: xfrin.c,v 1.166.522.1 2011/02/18 21:26:04 each Exp $ */
+/* $Id: xfrin.c,v 1.166.522.2 2011/02/19 01:21:27 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.
                 */