]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
fix quit on timeout, and printing trailing dots.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 22 Jan 2008 12:01:13 +0000 (12:01 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 22 Jan 2008 12:01:13 +0000 (12:01 +0000)
git-svn-id: file:///svn/unbound/trunk@885 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
libunbound/worker.c
smallapp/unbound-host.c
util/mini_event.c

index dba6ec7acce93575b356dc8e4f4cb0a39c03a8d9..a5c90b5e8676eb5407c73776a00b9c72d322d5de 100644 (file)
@@ -1,6 +1,7 @@
 22 January 2008: Wouter
        - library code for async in libunbound/unbound.c.
        - fix link testbound.
+       - fixup exit bug in mini_event.
 
 21 January 2008: Wouter
        - libworker work, netevent raw commpoints, write_msg, serialize.
index 1376a843e649942b001913c6d62ebf8a88c30679..fe9fdefe26a9f9568133fe27e89e245878c84391 100644 (file)
@@ -405,7 +405,7 @@ libworker_fg_done_cb(void* arg, int rcode, ldns_buffer* buf, enum sec_status s)
 
        if(rcode != 0) {
                d->q->res->rcode = rcode;
-               d->q->msg_security = 0;
+               d->q->msg_security = s;
                return;
        }
 
@@ -419,7 +419,6 @@ libworker_fg_done_cb(void* arg, int rcode, ldns_buffer* buf, enum sec_status s)
 
        /* canonname and results */
        d->q->msg_security = s;
-
        libworker_enter_result(d->q->res, buf, d->w->env->scratch, s);
 }
 
index f8f8782dc9999ca7839db8d2c7c1c5f28fe400db..1a11a3c1fe056f64def677394d06fcb1079561d7 100644 (file)
@@ -302,7 +302,8 @@ pretty_output(char* q, int t, int c, struct ub_val_result* result, int docname)
                printf("\n");
        }
        /* remove trailing . from long canonnames for nicer output */
-       if(result->canonname && strlen(result->canonname) > 1)
+       if(result->canonname && strlen(result->canonname) > 1 &&
+               result->canonname[strlen(result->canonname)-1] == '.')
                result->canonname[strlen(result->canonname)-1] = 0;
        if(!result->havedata) {
                if(verb > 0) {
index cba2ba3cea811d0f489f5af1da8bb189f227622c..10179264c7f8a09f36733faedc971eb3fbcc3e99 100644 (file)
@@ -204,6 +204,8 @@ int event_base_dispatch(struct event_base* base)
                        return -1;
                /* see if timeouts need handling */
                handle_timeouts(base, &now, &wait);
+               if(base->need_to_exit)
+                       return 0;
                /* do select */
                if(handle_select(base, &wait) < 0) {
                        if(base->need_to_exit)