]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Tests update.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 18 Oct 2007 09:24:57 +0000 (09:24 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 18 Oct 2007 09:24:57 +0000 (09:24 +0000)
git-svn-id: file:///svn/unbound/trunk@693 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/worker.c
doc/Changelog
testcode/fake_event.c
testdata/fwd_error.rpl
testdata/fwd_timeout.rpl

index ebde077bca5b317edddd8d095c60ed721ba82c8b..a8bf661d6b37f71daa563b3e754732572e18ba81 100644 (file)
@@ -796,6 +796,9 @@ void
 worker_sighandler(int sig, void* arg)
 {
        /* note that log, print, syscalls here give race conditions. */
+       /* we still print DETAIL logs, because this is extensive per message
+        * logging anyway, and the operator may then have an interest
+        * in the cause for unbound to exit */
        struct worker* worker = (struct worker*)arg;
        switch(sig) {
                case SIGHUP:
index 1ce00179a0b388922ca95fc4bee898cb7ae94f22..e515f9025d5f2f56dc51d88803ae02c830f52fcd 100644 (file)
@@ -1,5 +1,8 @@
 18 October 2007: Wouter
        - addresses are logged with errors.
+       - fixup testcode fake event to remove pending before callback
+         since the callback may create new pending items.
+       - tests updated because retries are now in iterator module.
 
 17 October 2007: Wouter
        - fixup another cycle detect and ns-addr timeout resolution bug.
index 261b012fb2facfa3bf739bcbdaed74220dc44a6b..971a027270faa6113c73ba7f4ee160337788721e 100644 (file)
@@ -380,6 +380,9 @@ fake_pending_callback(struct replay_runtime* runtime,
        struct fake_pending* p = runtime->pending_list;
        struct comm_reply repinfo;
        struct comm_point c;
+       void* cb_arg = p->cb_arg;
+       comm_point_callback_t* cb = p->callback;
+
        memset(&c, 0, sizeof(c));
        if(!p) fatal_exit("No pending queries.");
        log_assert(todo->qname == NULL); /* or find that one */
@@ -393,12 +396,12 @@ fake_pending_callback(struct replay_runtime* runtime,
        repinfo.c = &c;
        repinfo.addrlen = p->addrlen;
        memcpy(&repinfo.addr, &p->addr, p->addrlen);
-       if((*p->callback)(&c, p->cb_arg, error, &repinfo)) {
+       pending_list_delete(runtime, p);
+       if((*cb)(&c, cb_arg, error, &repinfo)) {
                fatal_exit("unexpected: pending callback returned 1");
        }
        /* delete the pending item. */
        ldns_buffer_free(c.buffer);
-       pending_list_delete(runtime, p);
 }
 
 /**
index c9deaeb097773fa1c8d1df83099cecc03430d256..73648c57c4bd971f19a2afc639e88074a212fa37 100644 (file)
@@ -8,9 +8,13 @@ SECTION QUESTION
 www.example.com. IN A
 ENTRY_END
 ; But the pending query fails due to error (say TCP failure or malloc or ...)
+; This is iterator/iterator.h OUTBOUND_MSG_RETRY number of errors.
 STEP 2 ERROR
+STEP 3 ERROR
+STEP 4 ERROR
+STEP 5 ERROR
 ; returns servfail
-STEP 4 CHECK_ANSWER
+STEP 14 CHECK_ANSWER
 ENTRY_BEGIN
 MATCH opcode qname qtype
 SECTION QUESTION
index d4f8c60b0adc4225b5f2d6ef3be30954a25d1180..c132eb3e62739b9f049fbc7cdeae2056ec5a447b 100644 (file)
@@ -8,9 +8,13 @@ SECTION QUESTION
 www.example.com. IN A
 ENTRY_END
 ; But the pending query times out!
+; OUTBOUND_MSG_RETRY times timeout.
 STEP 2 TIMEOUT
+STEP 3 TIMEOUT
+STEP 4 TIMEOUT
+STEP 5 TIMEOUT
 ; returns servfail
-STEP 4 CHECK_ANSWER
+STEP 14 CHECK_ANSWER
 ENTRY_BEGIN
 MATCH opcode qname qtype
 SECTION QUESTION