summaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-02-05 21:39:40 +0000
committerNick Mathewson <nickm@torproject.org>2008-02-05 21:39:40 +0000
commitc11c48fc783305fbb3a1b446b35dc3d9602d4bbe (patch)
tree82a480985d9d4b29f7033c777031d77b44f108cb /src/or/control.c
parentbd5bcbdc091dc40fe1337aeb45852c60343a92bf (diff)
downloadtor-c11c48fc783305fbb3a1b446b35dc3d9602d4bbe.tar.gz
tor-c11c48fc783305fbb3a1b446b35dc3d9602d4bbe.zip
r17913@catbus: nickm | 2008-02-05 16:11:33 -0500
Correctly register failures in connection_add() in dnsserv_launch_request() svn:r13387
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 31c88580df..afb88d2a9b 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -2439,7 +2439,7 @@ static int
handle_control_resolve(control_connection_t *conn, uint32_t len,
const char *body)
{
- smartlist_t *args;
+ smartlist_t *args, *failed;
int is_reverse = 0;
(void) len; /* body is nul-terminated; it's safe to ignore the length */
@@ -2458,14 +2458,21 @@ handle_control_resolve(control_connection_t *conn, uint32_t len,
tor_free(cp);
is_reverse = 1;
}
+ failed = smartlist_create();
SMARTLIST_FOREACH(args, const char *, arg, {
- dnsserv_launch_request(arg, is_reverse);
+ if (dnsserv_launch_request(arg, is_reverse)<0)
+ smartlist_add(failed, (char*)arg);
+ });
+
+ send_control_done(conn);
+ SMARTLIST_FOREACH(failed, const char *, arg, {
+ control_event_address_mapped(arg, arg, time(NULL),
+ "Unable to launch resolve request");
});
SMARTLIST_FOREACH(args, char *, cp, tor_free(cp));
smartlist_free(args);
-
- send_control_done(conn);
+ smartlist_free(failed);
return 0;
}